Skip to main content

Class: DataInterface<T, U>

A structure representing a source of named data that can be modified

Type parameters

NameType
TT
UT

Constructors

constructor

new DataInterface<T, U>(input, modify): DataInterface<T, U>

Constructs a new DataInterface

Type parameters

NameType
TT
UT

Parameters

NameTypeDescription
inputSubscribable<T> | Consumer<T>an input for data
modify(value: U) => voida callback when the data needs to be modified

Returns

DataInterface<T, U>

Defined in

src/sdk/fmc/FmcDataBinding.ts:15

Properties

input

Readonly input: Subscribable<T> | Consumer<T>

an input for data

Defined in

src/sdk/fmc/FmcDataBinding.ts:16


modify

modify: (value: U) => void

a callback when the data needs to be modified

Type declaration

▸ (value): void

a callback when the data needs to be modified

Parameters
NameType
valueU
Returns

void

Defined in

src/sdk/fmc/FmcDataBinding.ts:17

Methods

fromConsumer

fromConsumer<T, U>(consumer, modifier): DataInterface<T, U>

Creates a DataInterface from a Consumer

Type parameters

NameType
TT
UT

Parameters

NameTypeDescription
consumerConsumer<T>the Consumer to bind to (get)
modifier(value: U) => voidthe modifier to use when the value is modified (set)

Returns

DataInterface<T, U>

the DataInterface

Defined in

src/sdk/fmc/FmcDataBinding.ts:36


fromMutSubscribable

fromMutSubscribable<T, U>(sub): DataInterface<T, U>

Creates a DataInterface from a MutableSubscribable

Type parameters

NameType
TT
UT

Parameters

NameTypeDescription
subMutableSubscribable<T, U>the MutableSubscribable to bind to

Returns

DataInterface<T, U>

the DataInterface

Defined in

src/sdk/fmc/FmcDataBinding.ts:26