Skip to content

Commit

Permalink
follow #2472
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Mar 29, 2024
1 parent 387bc20 commit 22f9039
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vanilla/store2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type OnUnmount = () => void
type Getter = Parameters<AnyAtom['read']>[0]
type Setter = Parameters<AnyWritableAtom['write']>[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 = <T extends Atom<AnyValue>>(
Expand Down Expand Up @@ -103,10 +103,10 @@ const isContinuablePromise = (
): promise is ContinuablePromise<AnyValue> =>
typeof promise === 'object' && promise !== null && CONTINUE_PROMISE in promise

const continuablePromiseMap = new WeakMap<
const continuablePromiseMap: WeakMap<
PromiseLike<AnyValue>,
ContinuablePromise<AnyValue>
>()
> = new WeakMap()

/**
* Create a continuable promise from a regular promise.
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit 22f9039

Please sign in to comment.