Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memoized useActions #938

Merged
merged 1 commit into from
Apr 9, 2021
Merged

Memoized useActions #938

merged 1 commit into from
Apr 9, 2021

Conversation

izri16
Copy link
Collaborator

@izri16 izri16 commented Apr 7, 2021

Current useActions is not memoized which means that every re-render of a component that uses it creates whole new actions. This leads to infinite cycle when actions are used as dependencies in useEffect.
With this change component should get new actions only once when it uses useActions, however every component that uses useActions still gets new actions object (I will also try to improve that, maybe in another PR)
This would need some testing of the core functionality whether nothing got broken (but I guess that cypress tests could do it 🥳 )

@izri16 izri16 added needs review PR waiting to be reviewed refactor labels Apr 7, 2021
@izri16 izri16 requested review from ppershing and PeterBenc April 7, 2021 07:09
@izri16 izri16 self-assigned this Apr 7, 2021
@mlenik mlenik temporarily deployed to adalite-memoized-use-ac-3yogib April 7, 2021 07:09 Inactive
* replace unnecessary `useRef` in delegatePage
@izri16 izri16 force-pushed the memoized-use-actions branch from 9389cde to 9468513 Compare April 9, 2021 15:09
@izri16 izri16 removed the needs review PR waiting to be reviewed label Apr 9, 2021
@izri16 izri16 temporarily deployed to adalite-memoized-use-ac-3yogib April 9, 2021 15:09 Inactive
@izri16 izri16 merged commit 5a1efc1 into develop Apr 9, 2021
@izri16 izri16 deleted the memoized-use-actions branch April 9, 2021 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants