MCPcopy
hub / github.com/vercel/next.js / bindSnapshot

Function bindSnapshot

packages/next/src/server/app-render/async-local-storage.ts:48–56  ·  view source on GitHub ↗
(
  // WARNING: Don't pass a named function to this argument! See: https://github.com/facebook/react/pull/34911
  fn: T
)

Source from the content-addressed store, hash-verified

46}
47
48export function bindSnapshot<T>(
49 // WARNING: Don't pass a named function to this argument! See: https://github.com/facebook/react/pull/34911
50 fn: T
51): T {
52 if (maybeGlobalAsyncLocalStorage) {
53 return maybeGlobalAsyncLocalStorage.bind(fn)
54 }
55 return FakeAsyncLocalStorage.bind(fn)
56}
57
58export function createSnapshot(): <R, TArgs extends any[]>(
59 fn: (...args: TArgs) => R,

Callers 2

addCallbackMethod · 0.90
patchedSetImmediateFunction · 0.90

Calls 1

bindMethod · 0.45

Tested by

no test coverage detected