@univerjscorefunctionsFromcallback

@univerjs/core v0.5.0-beta.1Docs


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

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/rxjs.ts:32