MCPcopy Create free account
hub / github.com/effector/effector / getScope

Function getScope

src/react/scope.ts:7–12  ·  view source on GitHub ↗
(forceScope?: boolean)

Source from the content-addressed store, hash-verified

5const ScopeContext = React.createContext(null as Scope | null)
6export const {Provider} = ScopeContext
7export function getScope(forceScope?: boolean) {
8 const scope = React.useContext(ScopeContext)
9 if (forceScope && !scope)
10 throwError('No scope found, consider adding <Provider> to app root')
11 return scope as Scope
12}

Callers 14

GateComponentFunction · 0.90
useEventFunction · 0.90
useStoreFunction · 0.90
useUnitFunction · 0.90
useStoreMapFunction · 0.90
useListFunction · 0.90
useGateFunction · 0.90
useProvidedScopeFunction · 0.90
useStoreFunction · 0.90
useUnitFunction · 0.90
useListFunction · 0.90
useStoreMapFunction · 0.90

Calls 1

throwErrorFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…