@univerjs/core v0.5.0-beta.1 • 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 | packages/api/tmp/univer-pro/node_modules/.pnpm/@wendellhu+redi@0.16.1/node_modules/@wendellhu/redi/esm/react-bindings/reactRx.d.ts:33 |
value | T | undefined | packages/api/tmp/univer-pro/node_modules/.pnpm/@wendellhu+redi@0.16.1/node_modules/@wendellhu/redi/esm/react-bindings/reactRx.d.ts:37 |
Defined in
packages/api/tmp/univer-pro/node_modules/.pnpm/@wendellhu+redi@0.16.1/node_modules/@wendellhu/redi/esm/react-bindings/reactRx.d.ts:32