Skip to main content

OwnerVerbs

Defined in: js-api/src/u2core/component.ts:1034

The owner verbs every component has, its Component.scope's: build(fn) runs fn with it ambient, task runs async work for it, subscribe owns a stream. The engine puts them on every component; their types come with u2 (@datagrok-libraries/u2 declares them on Component), so a platform class that has a member of one of these names of its own (a function view's build()) keeps it and still compiles.

Methods​

build()​

build<T>(fn): T

Defined in: js-api/src/u2core/component.ts:1036

Runs fn now with this owner ambient: what it builds is owned here. See Scope.build.

Type Parameters​

Type Parameter
T

Parameters​

ParameterType
fn() => T

Returns​

T


subscribe()​

subscribe<T>(source, handler): () => void

Defined in: js-api/src/u2core/component.ts:1040

Subscribes handler to source until this owner is disposed. See Scope.subscribe.

Type Parameters​

Type Parameter
T

Parameters​

ParameterType
sourceObservableLike<T>
handler(value) => void

Returns​

() => void


task()​

task<R>(fn, options?): TaskRun

Defined in: js-api/src/u2core/component.ts:1038

Async work owned here. See Scope.task.

Type Parameters​

Type Parameter
R

Parameters​

ParameterType
fn(t) => R | PromiseLike<R>
options?TaskOptions

Returns​

TaskRun