@@ -34,7 +34,7 @@ import type {
3434 useSynchronizer as useSynchronizerDecl ,
3535 useSynchronizerIds as useSynchronizerIdsDecl ,
3636} from '../@types/ui-react/index.d.ts' ;
37- import { IdObj , objEnsure , objGet , objIds } from '../common/obj.ts' ;
37+ import { IdObj , objGet , objIds } from '../common/obj.ts' ;
3838import { GLOBAL , isString , isUndefined } from '../common/other.ts' ;
3939import { createContext , useContext , useEffect } from '../common/react.ts' ;
4040import { TINYBASE } from '../common/strings.ts' ;
@@ -99,11 +99,14 @@ export type ContextValue = [
9999 delExtraThingById ?: ( offset : Offsets , id : string ) => void ,
100100] ;
101101
102- export const Context : React . Context < ContextValue > = objEnsure (
103- GLOBAL ,
104- TINYBASE + '_uirc' ,
105- ( ) => createContext < ContextValue > ( [ ] ) ,
106- ) ;
102+ const TINYBASE_CONTEXT = TINYBASE + '_uirc' ;
103+
104+ export const Context : React . Context < ContextValue > = ( GLOBAL as any ) [
105+ TINYBASE_CONTEXT
106+ ]
107+ ? /*! istanbul ignore next */
108+ ( GLOBAL as any ) [ TINYBASE_CONTEXT ]
109+ : ( ( GLOBAL as any ) [ TINYBASE_CONTEXT ] = createContext < ContextValue > ( [ ] ) ) ;
107110
108111const useThing = < UsedThing extends Thing > (
109112 id : Id | undefined ,
0 commit comments