Created
April 17, 2017 04:58
-
-
Save iamvanja/0a4e2202b9857a0ce6569109111e4b2f to your computer and use it in GitHub Desktop.
Promise setState
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
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