Last active
February 17, 2019 00:43
-
-
Save keyvan-m-sadeghi/8cf71d8675df282fed20d172d2f54ac6 to your computer and use it in GitHub Desktop.
This file contains 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
class Nancy { | |
constructor(executor) { | |
const tryCall = callback => Nancy.try(() => callback(this.value)); | |
const members = { | |
[states.resolved]: { | |
... | |
then: trycall | |
}, | |
... | |
}; | |
... | |
} | |
... | |
static try(callback) { | |
return new Nancy(resolve => resolve(callback())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment