import * as React from 'react' ; import { DrilldownManagerState , DrilldownManagerStateDeps } from '../../state' ; const context = React . createContext < DrilldownManagerState | null > ( null ) ; export const useDrilldownManager = ( ) => React . useContext ( context ) ! ; export type DrilldownManagerProviderProps = DrilldownManagerStateDeps ; export const DrilldownManagerProvider = ( { children , ... deps } ) => { const value = React . useMemo ( ( ) => new DrilldownManagerState ( deps ) , [ ] ) ; return < context . Provider value = { value } > { children } < /context.Provider>; } ;