Skip to content

Instantly share code, notes, and snippets.

@tannerlinsley
Created February 4, 2019 15:03
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 tannerlinsley/e6ad5ccd99a74e15b4827fefd432a073 to your computer and use it in GitHub Desktop.
Save tannerlinsley/e6ad5ccd99a74e15b4827fefd432a073 to your computer and use it in GitHub Desktop.
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