| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | * |
| 7 | * @flow |
| 8 | */ |
| 9 | |
| 10 | import type {AsyncDispatcher} from 'react-reconciler/src/ReactInternalTypes'; |
| 11 | import type {ComponentStackNode} from './ReactFizzComponentStack'; |
| 12 | |
| 13 | import {currentTaskInDEV} from './ReactFizzCurrentTask'; |
| 14 | |
| 15 | function getCacheForType<T>(resourceType: () => T): T { |
| 16 | throw new Error('Not implemented.'); |
| 17 | } |
| 18 | |
| 19 | function cacheSignal(): null | AbortSignal { |
| 20 | throw new Error('Not implemented.'); |
| 21 | } |
| 22 | |
| 23 | export const DefaultAsyncDispatcher: AsyncDispatcher = { |
| 24 | getCacheForType, |
| 25 | cacheSignal, |
| 26 | } as any; |
| 27 | |
| 28 | if (__DEV__) { |
| 29 | DefaultAsyncDispatcher.getOwner = (): ComponentStackNode | null => { |
| 30 | if (currentTaskInDEV === null) { |
| 31 | return null; |
| 32 | } |
| 33 | return currentTaskInDEV.componentStack; |
| 34 | }; |
| 35 | } |