Trait
Provides a wrapper around a data field which may be an array, function or other primitive value.
Constructor Summary
Public Constructor | ||
public |
constructor(metric: string, data: *) Initializes trait data. |
Member Summary
Public Members | ||
public get |
Returns the associated metric type. |
|
public get |
Returns the typeof data being wrapped. |
Private Members | ||
private |
_data: * Stores the data to wrap. |
|
private |
Stores the Trait metric type. |
Method Summary
Public Methods | ||
public |
valueOf(params: *): * Returns the value of the given data. |
Public Constructors
Public Members
Private Members
Public Methods
public valueOf(params: *): * source
Returns the value of the given data. If the wrapped data is a function it is invoked with the given params
otherwise the data is returned directly. If the wrapped data is an array a mapped version is returned
with each entry that is a function being invoked with the given params
.
Params:
Name | Type | Attribute | Description |
params | * | Provides parameters which are forwarded onto any data stored as a function. Normally
|
Return:
* |