Skip to content

Instantly share code, notes, and snippets.

@iamvanja
Created April 17, 2017 04:58
Show Gist options
  • Save iamvanja/0a4e2202b9857a0ce6569109111e4b2f to your computer and use it in GitHub Desktop.
Save iamvanja/0a4e2202b9857a0ce6569109111e4b2f to your computer and use it in GitHub Desktop.
Promise setState
function setStatePromise(that, newState) {
return new Promise((resolve) => {
that.setState(newState, () => {
resolve();
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment