diff --git a/src/vanilla/store.ts b/src/vanilla/store.ts index e912538832..9cc527a524 100644 --- a/src/vanilla/store.ts +++ b/src/vanilla/store.ts @@ -199,6 +199,7 @@ type SecretStoreMethods = readonly [ atom: Atom, atomState: AtomState, ) => Mounted | undefined, + recomputeInvalidatedAtoms: () => void, ] type Store = { @@ -229,7 +230,6 @@ type BuildStore = ( atom: WritableAtom, ...params: Parameters['write']> ) => Result, - atomOnInit?: (atom: AnyAtom, store: Store) => void, atomOnMount?: ( atom: WritableAtom, setAtom: (...args: Args) => Result, @@ -240,7 +240,6 @@ const buildStore: BuildStore = ( ensureAtomState, atomRead = (atom, ...params) => atom.read(...params), atomWrite = (atom, ...params) => atom.write(...params), - atomOnInit = (atom, store) => atom.unstable_onInit?.(store), atomOnMount = (atom, setAtom) => atom.onMount?.(setAtom), ): Store => { // These are store state. @@ -699,6 +698,7 @@ const buildStore: BuildStore = ( writeAtomState, mountAtom, unmountAtom, + recomputeInvalidatedAtoms, ], } return store