API Reference
@univerjs
@univerjs/core
functions
Fromcallback

@univerjs/core v0.4.2Docs


Function: fromCallback()

function fromCallback<T>(callback): Observable<T>

Creates an observable from a callback function.

Type Parameters

Type Parameter
T extends readonly unknown[]

Parameters

ParameterTypeDescription
callbackCallbackFn<T>The callback function that will be called when the observable is subscribed to. Please not that the if the callback function has this context, it will be lost when the callback is called. So you probably should bind the callback to the correct context.

Returns

Observable<T>

The observable that will emit when the callback function gets called.

Defined in

submodules/univer/packages/core/src/shared/rxjs.ts:32 (opens in a new tab)


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