This mixin contains client specific code for the Barefoot.DataStore component.
Code for serializing the DataStore on the server is contained here.
Barefoot. | This mixin contains client specific code for the Barefoot.DataStore component. |
Functions | |
toJSON | Serializes all models and collections of this DataStore into a plain JavaScript object. |
function toJSON()
Serializes all models and collections of this DataStore into a plain JavaScript object.
Beside the actual data, this object contains meta information to accomplish a proper deserialization with Barefoot.DataStore.Client.parse. This means, the DataStore can completely restore its content from a given serialized version of itself, including correct model and collection types.
Please make sure you registered all model and collection types with Barefoot.DataStore.registerModel and Barefoot.DataStore.registerCollection. Otherwise parse will throw an error as soon as i tries to deserialize such an object.
(Object) A serialized version of this DataStore
Serializes all models and collections of this DataStore into a plain JavaScript object.
function toJSON()
Takes serialized DataStore information (most commonly created with Barefoot.DataStore.Server.toJSON) and tries to restore the described datastructure.
function parse( serializedStore )
Registers a specific Barefoot.Model or Barefoot.Collection with the given identifier.
function registerModel( identifier, model )
An alias for registerModel.
function registerCollection( identifier, model )