✅ level 1: "BD" and level 2: "BD"
✅ level 1: "BD" and level 2: "DB"
✅ level 1: "DB" and level 2: "BD"
✅ level 1: "DB" and level 2: "DB"
07_writable
✅ "writableAtom" updates its value in both scoped and unscoped and read scoped atom (27 ms)
✅ "thisWritableAtom" updates its value in both scoped and unscoped and read scoped atom (5 ms)
Summary of changes
Update ScopeProvider to use the new
unstable_derive
api on store (https://github.com/pmndrs/jotai/pull/2652). The new code is much simpler and should address https://github.com/jotaijs/jotai-scope/issues/25 and https://github.com/jotaijs/jotai-scope/issues/36.Changes
store
prop added to ScopeProvider props. The scoped store will use the internals of this store if provided.Tests Results
01_basic_spec
✅ 01. ScopeProvider does not provide isolation for unscoped primitive atoms
✅ 02. unscoped derived atoms are unaffected in ScopeProvider
✅ 03. ScopeProvider provides isolation for scoped primitive atoms
❌ 04. unscoped derived can read and write to scoped primitive atoms
❌ 05. unscoped derived can read both scoped and unscoped atoms
❌ 06. dependencies of scoped derived are implicitly scoped
❌ 07. scoped derived atoms can share implicitly scoped dependencies
✅ 08. nested scopes provide isolation for primitive atoms at every level
❌ 09. unscoped derived atoms in nested scoped can read and write to scoped primitive atoms at every level
❌ 10. inherited scoped derived atoms can read and write to scoped primitive atoms at every nested level
02_removeScope
✅ atom get correct value when ScopeProvider is added/removed
03_nested
✅ nested primitive atoms are correctly scoped
04_derived
❌ parent scope's derived atom is prior to nested scope's scoped base
05_derived_self
❌ derived dep scope is preserved in self reference
06_implicit_parent
✅ level 1: "BD" and level 2: "BD" ✅ level 1: "BD" and level 2: "DB" ✅ level 1: "DB" and level 2: "BD" ✅ level 1: "DB" and level 2: "DB"
07_writable
✅ "writableAtom" updates its value in both scoped and unscoped and read scoped atom (27 ms) ✅ "thisWritableAtom" updates its value in both scoped and unscoped and read scoped atom (5 ms)