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

Workaround missing dispatch bailout #124

Conversation

js-jslog
Copy link
Owner

As raised here we need a workaround to avoid the many unnecessary renders that this strategy will otherwise produce.

I'm happy with this. It's just about as readable as the original design and only introduces a very small surface area to be tested.

The reason so many files are involved included in this diff now has more to do with this change revealing a gap in the test data setup which is best filled to avoid false positives as was experienced in this branch. See commit history for details; there's only 3 of them in this pull request.

js-jslog added 3 commits October 12, 2021 19:38
After raising this issue
(CharlesStover/reactn#215 (comment))
I'm happy to add this workaround setter which will be used instead of
the existing dispatches in this components hooks.

I will keep the reducers as they are, leaving the logic which determines
whether to return the previous or next property *in* the reducers so
that they would still be applicable to dispatch as would be the
"proper" design.
See previous commit for details.
It turns out that `reduce-harpstrata-to-rootpitchid` was implemented
incorrectly, but it wasn't picked up by the test because harpKeyId and
rootPitchId are the same in first position. Updating the position of
this base test data in to second position makes this kind of false
positive less likely. Several test files have had to be updated along
with this change.
Copy link
Owner Author

@js-jslog js-jslog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@js-jslog js-jslog merged commit 74e2142 into simplify-global-source-state-callbacks-with-dispatch Oct 13, 2021
@js-jslog js-jslog deleted the workaround-missing-dispatch-bailout branch October 13, 2021 17:15
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.

None yet

1 participant