Module: Models/Entities

Entities functions

Common functions that will be available on all entities

Source:

Methods

(static) add(state, entity) → {Object}

Add a new entity to the current State

Parameters:
Name Type Description
state Object

Current state

entity Object

New entity

Source:
Returns:

New entity

Type
Object

(static) fullRefresh(state, entities) → {Object}

Full refresh of entities

Parameters:
Name Type Description
state Object

Current State

entities Array.<Object>

New entities list

Source:
Returns:

New entities list

Type
Object

(static) get(state, entityId) → {Object}

Retrieve an entity

Parameters:
Name Type Description
state Object

Current State

entityId Number

Entity id

Source:
Returns:

Retrieved entity

Type
Object

(static) getAll(state) → {Array.<Object>}

Retrieve all entities Not very useful for the moment...but will be more fun when I add filters and such :D

Parameters:
Name Type Description
state Object

Current State

Source:
Returns:

Entity list

Type
Array.<Object>

(static) remove(state, removedEntity) → {Object}

Delete an entity

Parameters:
Name Type Description
state Object

Current State

removedEntity Number

Entity to remove

Source:
Returns:

Removed entity

Type
Object

(static) removeById(state, removedId) → {Object}

Delete an entity by its id

Parameters:
Name Type Description
state Object

Current State

removedId Number

Entity id to remove

Source:
Returns:

Removed entity

Type
Object

(static) update(state, removedId) → {Object}

Update an entity

Parameters:
Name Type Description
state Object

Current State

removedId Number

Entity id to remove

Source:
Returns:

Removed entity

Type
Object