theatre/packages/dataverse/api/interfaces/Prism-1.md
2023-08-10 13:31:54 +02:00

2.2 KiB

@theatre/dataverse / Prism

Interface: Prism<V>

Common interface for prisms.

Type parameters

Name
V

Table of contents

Properties

Methods

Properties

isHot

isHot: boolean

Whether the prism is hot.

Defined in

prism/Interface.ts:18


isPrism

isPrism: true

Whether the object is a prism.

Defined in

prism/Interface.ts:13

Methods

getValue

getValue(): V

Gets the current value of the prism. If the value is stale, it causes the prism to freshen.

Returns

V

Defined in

prism/Interface.ts:60


keepHot

keepHot(): VoidFn

Keep the prism hot, even if there are no tappers (subscribers).

Returns

VoidFn

Defined in

prism/Interface.ts:34


onChange

onChange(ticker, listener, immediate?): VoidFn

Calls listener with a fresh value every time the prism has a new value, throttled by Ticker.

Parameters

Name Type
ticker Ticker
listener (v: V) => void
immediate? boolean

Returns

VoidFn

Defined in

prism/Interface.ts:23


onStale

onStale(cb): VoidFn

Parameters

Name Type
cb () => void

Returns

VoidFn

Defined in

prism/Interface.ts:29