Skip to content

Instantly share code, notes, and snippets.

@paveltimofeev
Last active August 29, 2015 14:24
Show Gist options
  • Save paveltimofeev/d6bdda98e37ffed9be9e to your computer and use it in GitHub Desktop.
Save paveltimofeev/d6bdda98e37ffed9be9e to your computer and use it in GitHub Desktop.
JavaScript hooks, patterns, tricks
/// Bind
function done(){
console.log('> Done');
console.log( arguments );
}
function request( context, url, _done) { _done( context, url, _done ); }
var wrappedrequest = request.bind( null, 'doc._id' );
console.log('\r\n\r\n');
wrappedrequest( 'goo.gl', done );
request( null, 'goo.gl', done);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment