Skip to content

Repository files navigation

demo-use-thunk

The repository provides a demo for using use-thunk.

More specifically:

  1. Implement thunk-modules parent, child, grandChild and the corresponding ui-components Parent, Child, GrandChild.
  2. Implement thunk-module user as the ui-component-independent thunk-module.
  3. We can see that user info are shared across Header, Parent, and GrandChild.
  4. We can see from Parent that there is only 1 default parent. This parent is shared in main and in App
  5. The children ids in Parent are generated independently. Therefore, there are 4 different children in the corresponding Child components.
  6. We can see that grand children ids are defined in Parent and passed through Children's parameters. There are totally 8 different grand children in the corresponding GrandChild components.
  7. We can see that parent and child are equipped with async counter. The counters of parent (1 parent) and children (4 children) work independently.
  8. Through filtering child in the console log and adjusting all intervals of children to be 10 seconds, we can that updating 1 grandChild successfully re-renders object-wise GrandChild without re-rendering Parent, Child, and other GrandChildren.

About

Demo for use-thunk (async counter)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages