Skip to main content

Class: DataInterface<T, U>

Defined in: src/sdk/fmc/FmcDataBinding.ts:7

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

Type Parameters

Type ParameterDefault type
T-
UT

Constructors

Constructor

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

Defined in: src/sdk/fmc/FmcDataBinding.ts:15

Constructs a new DataInterface

Parameters

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

Returns

DataInterface<T, U>

Properties

input

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

Defined in: src/sdk/fmc/FmcDataBinding.ts:16

an input for data


modify()

modify: (value) => void

Defined in: src/sdk/fmc/FmcDataBinding.ts:17

a callback when the data needs to be modified

Parameters

ParameterType
valueU

Returns

void

Methods

fromConsumer()

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

Defined in: src/sdk/fmc/FmcDataBinding.ts:36

Creates a DataInterface from a Consumer

Type Parameters

Type ParameterDefault type
T-
UT

Parameters

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

Returns

DataInterface<T, U>

the DataInterface


fromMutSubscribable()

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

Defined in: src/sdk/fmc/FmcDataBinding.ts:26

Creates a DataInterface from a MutableSubscribable

Type Parameters

Type ParameterDefault type
T-
UT

Parameters

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

Returns

DataInterface<T, U>

the DataInterface