Created
February 4, 2019 15:03
-
-
Save tannerlinsley/e6ad5ccd99a74e15b4827fefd432a073 to your computer and use it in GitHub Desktop.
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
const useAsyncIncrement = () => { | |
const increment = useIncrement() | |
return async () => { | |
await new Promise(resolve => setTimeout(resolve, 1000)) | |
increment() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment