react/packages/react-devtools-shared/src/devtools/views/context.js

22 lines
598 B
JavaScript
Raw Normal View History

2019-08-28 01:54:01 +08:00
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
2019-01-23 03:04:37 +08:00
2019-08-14 08:58:03 +08:00
import {createContext} from 'react';
2019-01-23 03:04:37 +08:00
import Store from '../store';
2019-08-14 08:58:03 +08:00
import type {FrontendBridge} from 'react-devtools-shared/src/bridge';
export const BridgeContext = createContext<FrontendBridge>(
2019-08-14 08:58:03 +08:00
((null: any): FrontendBridge),
);
BridgeContext.displayName = 'BridgeContext';
2019-01-24 00:45:19 +08:00
export const StoreContext = createContext<Store>(((null: any): Store));
2019-02-02 01:25:54 +08:00
StoreContext.displayName = 'StoreContext';