From 22f9039e70fd5cfd27f5d58233a9093345a24c2c Mon Sep 17 00:00:00 2001 From: daishi Date: Fri, 29 Mar 2024 09:00:29 +0900 Subject: [PATCH] follow #2472 --- src/vanilla/store2.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vanilla/store2.ts b/src/vanilla/store2.ts index 24f289acfc..55a6258683 100644 --- a/src/vanilla/store2.ts +++ b/src/vanilla/store2.ts @@ -8,7 +8,7 @@ type OnUnmount = () => void type Getter = Parameters[0] type Setter = Parameters[1] -const isSelfAtom = (atom: AnyAtom, a: AnyAtom) => +const isSelfAtom = (atom: AnyAtom, a: AnyAtom): boolean => atom.unstable_is ? atom.unstable_is(a) : a === atom const hasInitialValue = >( @@ -103,10 +103,10 @@ const isContinuablePromise = ( ): promise is ContinuablePromise => typeof promise === 'object' && promise !== null && CONTINUE_PROMISE in promise -const continuablePromiseMap = new WeakMap< +const continuablePromiseMap: WeakMap< PromiseLike, ContinuablePromise ->() +> = new WeakMap() /** * Create a continuable promise from a regular promise. @@ -707,7 +707,7 @@ export const createStore = (): Store => { let defaultStore: Store | undefined -export const getDefaultStore = () => { +export const getDefaultStore = (): Store => { if (!defaultStore) { defaultStore = createStore() if (import.meta.env?.MODE !== 'production') {