CompositeMixin offer a common interface to manipulate recursive data.
Methods
-
<static> _load(resource)
-
template methodGroups Composite (recursive) logic.Parameters:
Name Type Description resourceObject (optional) A Resource object
Returns:
this -
<static> cleanedData()
-
Common method which is charge to clean the component inner data. All data-related inner components are collected into an Object instance.
Returns:
collected data-related inner components
- Type
- Object
-
<static> createField(type, name, schema, value, endpoint, append)
-
Common Method for composite container components (Resource, List)
Parameters:
Name Type Description typestring The Component type
namestring The Component name
schemaObject The Component (data-)schema
value* (optional) The component value
endpointstring The Application global endpoint
appendboolean If true, the created component instance is appended to
thisReturns:
A component instance
- Type
- *
-
<static> hasUpdated()
-
Common method which tells whether the component state is UPDATED or not In other words, whether one of its inner component is UPDATED or not
Returns:
true if UPDATED state
- Type
- boolean
-
<static> isEmpty(obj)
-
Allow to evaluate whether or not an Object instance is empty. Trick here is to use JS native mechanism to iterate over the object. If it cannot iterate, the Object is empty, otherwise not.
Parameters:
Name Type Description objObject Object instance to be evaluated
Returns:
Whether the Object is empty or not
- Type
- boolean
-
<static> load(resource)
-
Exposed (public)
template methodGroups Composite (recursive) logic.
Parameters:
Name Type Description resourceObject (optional) A Resource object
Returns:
this -
<static> reset()
-
Common Method for components
resetfeature Allow the component to restore its initial state (based on its$memoattribute)Returns:
this -
<static> selfCommit()
-
Common method to definitely set the updated components' values, after a successful Request to the backend has been acknowledged.
$memoattribute is overridden by the current$valueReturns:
this -
<static> selfUpdate(update, commit)
-
Common Method to allow one component to update itself.
Parameters:
Name Type Description updateObject The update payload
commitboolean If true,
selfCommitmethod is invokedReturns:
this -
<static> toString()
-
Composite Component String representation
Returns:
Composite Component string representation
- Type
- string