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

Refactor ProfilerContext to use reducer instead of multi-state #16444

Open
bvaughn opened this issue Aug 18, 2019 · 0 comments
Open

Refactor ProfilerContext to use reducer instead of multi-state #16444

bvaughn opened this issue Aug 18, 2019 · 0 comments
Labels

Comments

@bvaughn
Copy link
Contributor

bvaughn commented Aug 18, 2019

The ProfilerContext is currently comprised of several pieces of related state, each managed with useState. This necessitates awkward checks like this or even worse like this or this.

This context should be refactored to use a single reducer (useReducer) like TreeContext. This is a bit more involved at the moment because of suspense and the ProfilerContext being higher level than the suspense cache. Although maybe we could work around this by using some sort of subscription?

See related issues like #16441 and commit 4697f5b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants