Skip to content

Commit

Permalink
fix(graphin):add GraphinContect type
Browse files Browse the repository at this point in the history
  • Loading branch information
pomelo-nwu committed Jan 10, 2021
1 parent f59da1c commit 137f8f1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/graphin/src/GraphinContext.tsx
Expand Up @@ -6,9 +6,13 @@ const defaultContext = {
graph: {} as IGraph,
apis: {} as ApisType,
};
export interface GraphinContextType {
graph: IGraph;
apis: ApisType;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}

const GraphinContext: React.Context<GraphinContextType> = React.createContext(defaultContext);

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const GraphinContext: React.Context<{ graph: IGraph; apis: ApisType; [key: string]: any }> = React.createContext(
defaultContext,
);
export default GraphinContext;

0 comments on commit 137f8f1

Please sign in to comment.