Skip to content

Instantly share code, notes, and snippets.

@janpaepke
Last active July 4, 2022 10:37
Show Gist options
  • Select an option

  • Save janpaepke/803681c8c5e6f59a584de3b0733cb97d to your computer and use it in GitHub Desktop.

Select an option

Save janpaepke/803681c8c5e6f59a584de3b0733cb97d to your computer and use it in GitHub Desktop.
useEffect(() => {
const cleanup = reversibleTimeout(() => alert('one second has passed!'), 1000);
return cleanup;
}, []);
// which we can simplify further to ⬇
useEffect(() => reversibleTimeout(() => alert('one second has passed!'), 1000), []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment