Skip to content

fix(access-type): Perf fix, access action dispatch ⭐#101

Merged
Jeevan-Kishore merged 6 commits intomasterfrom
access-reducer
Jul 23, 2019
Merged

fix(access-type): Perf fix, access action dispatch ⭐#101
Jeevan-Kishore merged 6 commits intomasterfrom
access-reducer

Conversation

@Jeevan-Kishore
Copy link
Contributor

@Jeevan-Kishore Jeevan-Kishore commented Jul 23, 2019

Issue :

Store was updated recursively even when the values of access did not change.

Since mapStateToProps does a shallow compare, it re-rendered the components quite a lot leading to bad UX

Solution :

  • Check current action payload with the previous payload value and update if necessary
  • Use batch dispatch to update multiple attributes of the store once

@Jeevan-Kishore Jeevan-Kishore merged commit 394dbf0 into master Jul 23, 2019
@delete-merged-branch delete-merged-branch bot deleted the access-reducer branch July 23, 2019 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants