Created
October 27, 2015 01:14
-
-
Save evanlucas/33ce260023f9d6e7d2c3 to your computer and use it in GitHub Desktop.
arrows.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
module.exports = Client | |
function Client() { | |
this.name = 'client' | |
} | |
Client.prototype.run = function run(cb) { | |
const n = 'server' | |
setImmediate(() => { | |
cb(null, this.name, n) | |
}) | |
} | |
Client.prototype.runWithSelf = function runWithSelf(cb) { | |
const self = this | |
const n = 'server' | |
setImmediate(function() { | |
cb(null, self.name, n) | |
}) | |
} | |
Client.prototype.runWithBind = function runWithBind(cb) { | |
const n = 'server' | |
setImmediate(function() { | |
cb(null, this.name, n) | |
}.bind(this)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment