( // WARNING: Don't pass a named function to this argument! See: https://github.com/facebook/react/pull/34911 fn: T )
| 46 | } |
| 47 | |
| 48 | export 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 | |
| 58 | export function createSnapshot(): <R, TArgs extends any[]>( |
| 59 | fn: (...args: TArgs) => R, |
no test coverage detected