Skip to content

BlockSuite API Documentation / @blocksuite/store / Slot

Class: Slot<T>

Extended by

Type parameters

T = void

Implements

  • Disposable

Constructors

new Slot(undefined)

new Slot<T>(): Slot<T>

Returns

Slot<T>

Properties

_callbacks

private _callbacks: any

Source

packages/framework/global/dist/utils/slot.d.ts:4


_disposables

private _disposables: any

Source

packages/framework/global/dist/utils/slot.d.ts:5


_emitting

private _emitting: any

Source

packages/framework/global/dist/utils/slot.d.ts:3


subscribe

subscribe: <U>(selector, callback, config?) => Disposable

Type parameters

U

Parameters

selector: (state) => U

callback: (value) => void

config?: Object

config.equalityFn?: (a, b) => boolean

config.filter?: (state) => boolean

Returns

Disposable

Source

packages/framework/global/dist/utils/slot.d.ts:8

Methods

dispose()

dispose(): void

Returns

void

Implementation of

Disposable.dispose

Source

packages/framework/global/dist/utils/slot.d.ts:16


emit()

emit(v): void

Parameters

v: T

Returns

void

Source

packages/framework/global/dist/utils/slot.d.ts:14


filter()

filter(testFun): Slot<T>

Parameters

testFun: (v) => boolean

Returns

Slot<T>

Source

packages/framework/global/dist/utils/slot.d.ts:6


on()

on(callback): Disposable

Parameters

callback: (v) => unknown

Returns

Disposable

Source

packages/framework/global/dist/utils/slot.d.ts:7


once()

once(callback): Disposable

Parameters

callback: (v) => unknown

Returns

Disposable

Source

packages/framework/global/dist/utils/slot.d.ts:12


pipe()

pipe(that): Slot<T>

Parameters

that: Slot<T>

Returns

Slot<T>

Source

packages/framework/global/dist/utils/slot.d.ts:15


toDispose()

toDispose(disposables): Slot<T>

Parameters

disposables: Disposable[]

Returns

Slot<T>

Source

packages/framework/global/dist/utils/slot.d.ts:17


unshift()

unshift(callback): Disposable

Parameters

callback: (v) => unknown

Returns

Disposable

Source

packages/framework/global/dist/utils/slot.d.ts:13


Generated using TypeDoc and typedoc-plugin-markdown.