Skip to main content

Polled<S, K, V>

An external resource that is refreshed at some polling interval.

Type Parameters

Type ParameterDescription
S extends JsonType of data received from external resource.
K extends JsonType of keys.
V extends JsonType of values.

Implements

Constructors

new Polled()

new Polled<S, K, V>(
url,
duration,
conv,
encodeParams): Polled<S, K, V>

Parameters

ParameterTypeDefault valueDescription
urlstringundefinedHTTP endpoint of external resource to poll.
durationnumberundefinedRefresh interval, in milliseconds.
conv(data) => Entry<K, V>[]undefinedFunction to convert data of type S received from external resource to key-value entries.
encodeParams(params) => stringdefaultParamEncoderFunction to use to encode params of type Json for external resource request.

Returns

Polled<S, K, V>

Methods

close()

close(params): void

Parameters

ParameterType
paramsJson

Returns

void

Implementation of

ExternalResource.close


open()

open(params, callbacks): void

Parameters

ParameterType
paramsJson
callbacks{ error: (error) => void; loading: () => void; update: (updates, isInit) => void; }
callbacks.error(error) => void
callbacks.loading() => void
callbacks.update(updates, isInit) => void

Returns

void

Implementation of

ExternalResource.open