API Reference
@univerjs
@univerjs/core
functions
Useobservable

@univerjs/core v0.4.2Docs


Function: useObservable()

useObservable(observable)

function useObservable<T>(observable): T | undefined

Type Parameters

Type Parameter
T

Parameters

ParameterType
observableNullable<ObservableOrFn<T>>

Returns

T | undefined

Defined in

submodules/univer/node_modules/.pnpm/@wendellhu+redi@0.16.1/node_modules/@wendellhu/redi/esm/react-bindings/reactRx.d.ts:18

useObservable(observable, defaultValue)

function useObservable<T>(observable, defaultValue): T

Type Parameters

Type Parameter
T

Parameters

ParameterType
observableNullable<ObservableOrFn<T>>
defaultValueT

Returns

T

Defined in

submodules/univer/node_modules/.pnpm/@wendellhu+redi@0.16.1/node_modules/@wendellhu/redi/esm/react-bindings/reactRx.d.ts:19

useObservable(observable, defaultValue, shouldHaveSyncValue, deps)

function useObservable<T>(
   observable, 
   defaultValue, 
   shouldHaveSyncValue, 
   deps?): T

Type Parameters

Type Parameter
T

Parameters

ParameterType
observableNullable<ObservableOrFn<T>>
defaultValueundefined
shouldHaveSyncValuetrue
deps?any[]

Returns

T

Defined in

submodules/univer/node_modules/.pnpm/@wendellhu+redi@0.16.1/node_modules/@wendellhu/redi/esm/react-bindings/reactRx.d.ts:20

useObservable(observable, defaultValue, shouldHaveSyncValue, deps)

function useObservable<T>(
   observable, 
   defaultValue?, 
   shouldHaveSyncValue?, 
   deps?): T | undefined

Type Parameters

Type Parameter
T

Parameters

ParameterType
observableNullable<ObservableOrFn<T>>
defaultValue?undefined
shouldHaveSyncValue?true
deps?any[]

Returns

T | undefined

Defined in

submodules/univer/node_modules/.pnpm/@wendellhu+redi@0.16.1/node_modules/@wendellhu/redi/esm/react-bindings/reactRx.d.ts:21


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.