| 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 {ReactContext} from 'shared/ReactTypes'; |
| 11 | |
| 12 | import {createContext} from 'react'; |
| 13 | |
| 14 | export type FetchFileWithCaching = (url: string) => Promise<string>; |
| 15 | export type Context = FetchFileWithCaching | null; |
| 16 | |
| 17 | const FetchFileWithCachingContext: ReactContext<Context> = |
| 18 | createContext<Context>(null); |
| 19 | FetchFileWithCachingContext.displayName = 'FetchFileWithCachingContext'; |
| 20 | |
| 21 | export default FetchFileWithCachingContext; |