Skip to content

Instantly share code, notes, and snippets.

@matthewrobb
Created December 6, 2017 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewrobb/75ce4990d654ad7f0191852320003dcf to your computer and use it in GitHub Desktop.
Save matthewrobb/75ce4990d654ad7f0191852320003dcf to your computer and use it in GitHub Desktop.
'use strict';
export function free(fn) {
return function() {
return this === undefined ? fn.apply(undefined, arguments) : fn.call(undefined, this, ...arguments);
}
}
export function freeRight(fn) {
return function() {
return this === undefined ? fn.apply(undefined, arguments) : fn.call(undefined, ...arguments, this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment