@univerjs/core v0.4.2 • Docs
Function: useDependencyContext()
function useDependencyContext<T>(depValue$, defaultValue?): {
Provider: (props) => JSX.Element;
value: T | undefined;
}
subscribe to an observable value from a service, creating a context for it so it child component won't have to subscribe again and cause unnecessary
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
depValue$ | Observable <T > |
defaultValue ? | T |
Returns
{
Provider: (props) => JSX.Element;
value: T | undefined;
}
Name | Type | Defined in |
---|---|---|
Provider | (props ) => JSX.Element | submodules/univer/node_modules/.pnpm/@wendellhu+redi@0.16.1/node_modules/@wendellhu/redi/esm/react-bindings/reactRx.d.ts:33 |
value | T | undefined | submodules/univer/node_modules/.pnpm/@wendellhu+redi@0.16.1/node_modules/@wendellhu/redi/esm/react-bindings/reactRx.d.ts:37 |
Defined in
submodules/univer/node_modules/.pnpm/@wendellhu+redi@0.16.1/node_modules/@wendellhu/redi/esm/react-bindings/reactRx.d.ts:32