Skip to content

Instantly share code, notes, and snippets.

@kunigami
Created June 15, 2019 02:11
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 kunigami/fde63ca0d038c105809ab8314c1d195f to your computer and use it in GitHub Desktop.
Save kunigami/fde63ca0d038c105809ab8314c1d195f to your computer and use it in GitHub Desktop.
function fetchSomeStuff() {
return new Promise((resolve, reject) => {
someAsyncRequest()
.onSuccess(
payload => resolve(payload.value)
)
.onFailure(
payload => reject(payload.error)
)
.execute();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment