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/1e56f24e1b5dd94feab0e80f0ec38401 to your computer and use it in GitHub Desktop.
Save OliverJAsh/1e56f24e1b5dd94feab0e80f0ec38401 to your computer and use it in GitHub Desktop.
+const wait = (ms: number) => {
+ var start = new Date().getTime();
+ var end = start;
+ while (end < start + ms) {
+ end = new Date().getTime();
+ }
+};
+const expensiveSelector = () => wait(3000);
const connectThis = connect(state => ({
count: state,
+ expensiveData: expensiveSelector()
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment