Skip to content

Commit

Permalink
Expand test for AsyncLocalStorage for legacy browser compat (#61873)
Browse files Browse the repository at this point in the history
Simpler/cleaner alternative to #61872.
Attempting to fix bug
#58818 (comment)

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
karlkeefer and ijjk authored Jun 18, 2024
1 parent 44aeb08 commit 303e196
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/next/src/client/components/async-local-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class FakeAsyncLocalStorage<Store extends {}>
}
}

const maybeGlobalAsyncLocalStorage = (globalThis as any).AsyncLocalStorage
const maybeGlobalAsyncLocalStorage =
typeof globalThis !== 'undefined' && (globalThis as any).AsyncLocalStorage

export function createAsyncLocalStorage<
Store extends {},
Expand Down

0 comments on commit 303e196

Please sign in to comment.