Skip to content

Instantly share code, notes, and snippets.

@narqo
Last active December 17, 2015 09:29
Show Gist options
  • Save narqo/5587759 to your computer and use it in GitHub Desktop.
Save narqo/5587759 to your computer and use it in GitHub Desktop.
Some tricks with Promise-A+
var args = { /* ... */ };
someActionThatRetrievesArchPromise()
.then(function(Arch) {
var arch = Arch.alterArch();
return arch
.invoke.call(Arch, 'createExamplesNodes', args)
.then(function() {
return arch;
});
})
.then(function(arch) {
// do something \w `arch` object
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment