Skip to content

Commit

Permalink
avoid re-declaring store
Browse files Browse the repository at this point in the history
  • Loading branch information
mikearnaldi committed Dec 27, 2024
1 parent 0b57236 commit 13af68e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/effect/src/GlobalValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let globalStore: Map<unknown, any>
export const globalValue = <A>(id: unknown, compute: () => A): A => {
if (!globalStore) {
// @ts-expect-error
globalThis[globalStoreId] = new Map()
globalThis[globalStoreId] ??= new Map()
// @ts-expect-error
globalStore = globalThis[globalStoreId] as Map<unknown, any>
}
Expand Down

0 comments on commit 13af68e

Please sign in to comment.