Skip to content

Instantly share code, notes, and snippets.

@OliverJAsh
Created January 27, 2020 14:48
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 OliverJAsh/3e4a678d7131505899997bc71ee8ccf0 to your computer and use it in GitHub Desktop.
Save OliverJAsh/3e4a678d7131505899997bc71ee8ccf0 to your computer and use it in GitHub Desktop.
<button
onClick={() => {
fetch("https://httpbin.org/get").then(() => {
- dispatch(increment());
- dispatch(increment());
+ batch(() => {
+ dispatch(increment());
+ dispatch(increment());
+ });
});
}}
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment