Class: DataInterface<T, U>
A structure representing a source of named data that can be modified
Type parameters
Name | Type |
---|---|
T | T |
U | T |
Constructors
constructor
• new DataInterface<T
, U
>(input
, modify
): DataInterface
<T
, U
>
Constructs a new DataInterface
Type parameters
Name | Type |
---|---|
T | T |
U | T |
Parameters
Name | Type | Description |
---|---|---|
input | Subscribable <T > | Consumer <T > | an input for data |
modify | (value : U ) => void | a 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
Name | Type |
---|---|
value | U |
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
Name | Type |
---|---|
T | T |
U | T |
Parameters
Name | Type | Description |
---|---|---|
consumer | Consumer <T > | the Consumer to bind to (get) |
modifier | (value : U ) => void | the 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
Name | Type |
---|---|
T | T |
U | T |
Parameters
Name | Type | Description |
---|---|---|
sub | MutableSubscribable <T , U > | the MutableSubscribable to bind to |
Returns
DataInterface
<T
, U
>
the DataInterface
Defined in
src/sdk/fmc/FmcDataBinding.ts:26