Skip to content

Instantly share code, notes, and snippets.

@keyvan-m-sadeghi
Last active February 17, 2019 00:43
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 keyvan-m-sadeghi/8cf71d8675df282fed20d172d2f54ac6 to your computer and use it in GitHub Desktop.
Save keyvan-m-sadeghi/8cf71d8675df282fed20d172d2f54ac6 to your computer and use it in GitHub Desktop.
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