Closed moriyuu closed 2 weeks ago
Would https://github.com/pmndrs/jotai/issues/2652 address your use case?
manage specific atoms in a custom store
Following up on this, what does this management mean?
Closing this ticket due to lack of activity. We can reopen if there is renewed interest.
Proposed Change
Enhance the
ScopeProvider
to allow selective store management. Specifically, add astore
prop toScopeProvider
that would only apply to the atoms specified in theatoms
prop. Atoms not listed would be managed by the parent store or the default store.Motivation
In complex applications, there's often a need to manage specific atoms in a custom store while leaving others to be managed by a parent or default store. The current implementation of using
Provider
andScopeProvider
together doesn't achieve this selective management.For example, the following doesn't work as desired:
In this setup, all atoms are managed by
myStore
, not justatom1
andatom2
.