ModelProperty
Extends:
Static Method Summary
Static Public Methods | ||
public static |
modelDefinitionFor(state: *, collection: *): {"id": *, "cid": *, "data": *, "dirty": *, "lastReqId": *, "waiting": *} |
Constructor Summary
Public Constructor | ||
public |
constructor(stateType: *) |
Member Summary
Public Members | ||
public |
[_busy]: * |
|
public get |
cid: * |
|
public get |
collection: * |
|
public get |
data: * |
|
public get |
id: * |
Method Summary
Public Methods | ||
public |
changeId(id: *) |
|
public |
|
|
public |
|
|
public |
create$(impl: *): * |
|
public |
defaults(data: *) |
|
public |
destroy(): * |
|
public |
isDirty(): * |
|
public |
isNew(): * |
|
public |
isWaiting(): * |
|
public |
merge(data: *) |
|
public |
propertyChildInvalidated(childProperty: *) |
|
public |
|
|
public |
save(): * |
|
public |
setBusy(busy: *) |
|
public |
setData(data: *) |
Inherited Summary
From class Property | ||
public |
|
|
public |
|
|
public |
|
|
public |
[_checkpoint]: {"data": *} |
|
public |
[_impl]: * |
|
public |
|
|
public |
[_mixins]: *[] |
|
public |
[_parent]: * |
|
public |
[_pid]: * |
|
public |
[_readonly]: * |
|
public |
[_shader]: * |
|
public |
[_stateType]: * |
|
public |
[_store]: * |
|
public |
Use this.$$() in shadow methods to get access to the property. |
|
public |
Gets if autoshadowing is enabled for this property. |
|
public |
Copies the current actual state for later reset using Property#resetToCheckpoint. |
|
public |
Clears an existing checkpoint created using Property#checkpoint. |
|
public |
Creates the object to be assigned to the shadow.$ property. |
|
public |
Gets the path from root property using a dot ( |
|
public |
getCheckpoint(): * Gets the checkpoint state previously recorded using Property#checkpoint. |
|
public |
getInitialState(state: *): * Gets the initial state for a property at the beginning of the property mounting process. |
|
public |
Gets if an existing checkpoint has be created using Property#checkpoint. |
|
public |
initialState(): * Gets the result from StateType#computeInitialState. |
|
public |
Gets if the property is currently shadowing an actual state property. |
|
public |
Gets if property is an actual isolated property managed by the store. |
|
public |
Gets if the property allows for assignment through the shadow state, ie |
|
public |
Gets if this is the shadow state root property. |
|
public |
The property name by which this property is referenced by the Property.parent. |
|
public |
nextState(): * Gets what the actual state for this property will be after the Store updates all pending actions. |
|
public |
Gets the object containing or managing this property. |
|
public |
Gets the parent property. |
|
public |
Gets the parent's shadow property. |
|
public |
path(): [] Gets the Property#name components from the root property to this property. |
|
public |
Gets the unique f.lux ID for this property. |
|
public |
propertyChildInvalidated(childProperty: Property, sourceProperty: Property) A child property or one of its descendents wil be changing state. |
|
public |
Invoked by the f.lux shadowing process after a property initially shadows a state property. |
|
public |
Invoked by the f.lux shadowing process after a property is reshadowed. |
|
public |
Invoked by the f.lux shadowing process just before a property initially shadows a state property. |
|
public |
Invoked by the f.lux shadowing process just before a property will be removed from the shadow state. |
|
public |
Replaces the current property state with a checkpoint state previously recorded using Property#checkpoint. |
|
public |
Gets the shadow state root property for the Store managing this property. |
|
public |
rootShadow(): Shadow Gets the root shadow state for the Store managing this property. |
|
public |
setAutoshadow(auto: boolean): * Sets the auto shadow property flag. |
|
public |
setImplementationClass(ImplClass: *) |
|
public |
setInitialState(state: *): Property Explicitly sets an initial state that will be used if the state tree does not have a value for this property. |
|
public |
setReadonly(readonly: *) Sets the readonly flag which will prevent an assignment from changing the value. |
|
public |
setShadowClass(ShadowClass: Shadow) Sets the class to be used for the shadow api |
|
public |
shader(state: *): * Gets the Shader instance for this property. |
|
public |
shadowClass(): * Returns the Shadow subclass used to virtualize the state property. |
|
public |
Gets the path from root property using a slash ( |
|
public |
state(): * Gets the actual state being shadowed. |
|
public |
stateType(): * Gets the StateType used for creating this property. |
|
public |
store(): * Gets the {@Link Store} containing the application state. |
|
public |
touch() Triggers a reshadow of the properties shadow state. |
|
public |
typeName(): * Gets this property's StateType.typeName value. |
|
public |
Makes changes to the next proeprty state. |
From class ObjectProperty | ||
public static |
createClass(shadowType: Object | Shadow, typeCallback: function(type: StateType), initialState: Object): ObjectProperty Factory function for creating an |
|
public static |
defineType(PropClass: ObjectProperty, ShadowType: Object | Shadow, typeCallback: function(type: StateType), initialState: Object) Factory function for setting up the StateType |
Static Public Methods
public static modelDefinitionFor(state: *, collection: *): {"id": *, "cid": *, "data": *, "dirty": *, "lastReqId": *, "waiting": *} source
Params:
Name | Type | Attribute | Description |
state | * | ||
collection | * |
Return:
{"id": *, "cid": *, "data": *, "dirty": *, "lastReqId": *, "waiting": *} |
Public Constructors
public constructor(stateType: *) source
If a StateType is not passed to this constructor then one is located using StateType.from thus ensuring the f.lux shadowing process is defined for this property.
Override:
ObjectProperty#constructorParams:
Name | Type | Attribute | Description |
stateType | * |
|
Public Members
public [_busy]: * source
public get cid: * source
public get collection: * source
public get data: * source
public get id: * source
Public Methods
public clearCheckpoint() source
Clears an existing checkpoint created using Property#checkpoint.
Override:
Property#clearCheckpointpublic clearDirty() source
public create$(impl: *): * source
Creates the object to be assigned to the shadow.$ property. Subclasses can override this method
to setup a chain of specialized accessors ($()
). See Access for details on setting up
specialized accessors. This is an advanced feature and rarely required.
Override:
Property#create$Params:
Name | Type | Attribute | Description |
impl | * |
Return:
* |
public propertyChildInvalidated(childProperty: *) source
A child property or one of its descendents wil be changing state. Useful hook when a property needs to perform some bookkeepng for child properties. Utilizing this hook provides a chance to make tracking changes in shadow properties before the store updates its state.
Subclasses do not need to invoke the parent implementation.
Override:
Property#propertyChildInvalidatedParams:
Name | Type | Attribute | Description |
childProperty | * |
public resetDataToCheckpoint() source
public setBusy(busy: *) source
Params:
Name | Type | Attribute | Description |
busy | * |