Skip to content

Commit

Permalink
Add type for state
Browse files Browse the repository at this point in the history
  • Loading branch information
estermv committed Aug 24, 2021
1 parent f26f958 commit 91cbaed
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ import React, { createContext } from 'react';
import { GlobalState } from '../url_state';
import { MonitoringStartPluginDependencies } from '../types';

export const GlobalStateContext = createContext({});

interface GlobalStateProviderProps {
query: MonitoringStartPluginDependencies['data']['query'];
toasts: MonitoringStartPluginDependencies['core']['notifications']['toasts'];
children: React.ReactNode;
}

interface State {
cluster_uuid?: string;
}

export const GlobalStateContext = createContext({} as State);

export const GlobalStateProvider = ({ query, toasts, children }: GlobalStateProviderProps) => {
const fakeRootScope: Partial<ng.IRootScopeService> = {
$on: (
Expand Down

0 comments on commit 91cbaed

Please sign in to comment.