This repository has been archived by the owner on Apr 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notify components in hierarchical order
Components used to subscribe to store updates in componentDidMount, and it runs from lowest hierarchy. A child could subscribe earlier and receive update earlier than its parent, but it might recieve new props, or be removed after update of its parent. Changes are made to fix inconsistencies, by notifying components in hierarchical order. All components that subscribe to store updates now create a new listener collection for its children, and notify after update. This fixes reduxjs/react-redux#292 . Updates to components are initiated by calling top level listeners, and these components notify their children after handling changes. reduxjs/react-redux#398 is also fixed by send only necessary notifications: When a component don't have to update in response to state changes, its children is notified by calling the listeners. When a component need to update, its listeners are not called, use simply setState(empty), and let React handle the rest.
- Loading branch information
Showing
2 changed files
with
36 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters