DS.Store#push()

push (data) DS.Model|Array Defined in addon/-private/system/store.js:1962 Push some data for a given type into the store. This method expects normalized JSON API document. This means you have to follow JSON API specification with few minor adjustments: - record's type should always be in singular, dasherized form - members (properties) should be camelCased Your primary data should be wrapped inside data property: store.push({ data: { // primary data for single record of type `Person`

DS.Store#init()

initprivate Defined in addon/-private/system/store.js:215

DS.Store#modelFor()

modelFor (modelName) DS.Model Defined in addon/-private/system/store.js:1921 Returns the model class for the particular modelName. The class of a model might be useful if you want to get a list of all the relationship names of the model, see relationshipNames for example. Parameters: modelName String Returns: DS.Model

DS.Store#normalize()

normalize (modelName, payload) Object Defined in addon/-private/system/store.js:2271 normalize converts a json payload into the normalized form that push expects. Example socket.on('message', function(message) { var modelName = message.model; var data = message.data; store.push(store.normalize(modelName, data)); }); Parameters: modelName String The name of the model type for this payload payload Object Returns: Object The normalized payload

DS.Store#hasRecordForId()

hasRecordForId (modelName, inputId) Boolean Defined in addon/-private/system/store.js:966 Returns true if a record for a given type and ID is already loaded. Parameters: modelName (String|DS.Model) inputId (String|Integer) Returns: Boolean

DS.Store#getReference()

getReference (type, id) RecordReference Defined in addon/-private/system/store.js:869 Available since 2.5.0 Get the reference for the specified record. Example var userRef = store.getReference('user', 1); // check if the user is loaded var isLoaded = userRef.value() !== null; // get the record of the reference (null if not yet available) var user = userRef.value(); // get the identifier of the reference if (userRef.remoteType() === "id") { var id = userRef.id(); } // load user (via stor

DS.Store#flushPendingSave()

flushPendingSaveprivate Defined in addon/-private/system/store.js:1708 This method is called at the end of the run loop, and flushes any records passed into scheduleSave

DS.Store#findRecord()

findRecord (modelName, id, options) Promise Defined in addon/-private/system/store.js:461 Available since 1.13.0 This method returns a record for a given type and id combination. The findRecord method will always resolve its promise with the same object for a given type and id. The findRecord method will always return a promise that will be resolved with the record. Example app/routes/post.js import Ember from 'ember'; export default Ember.Route.extend({ model: function(params) { ret

DS.Store#findByIds()

findByIds (modelName, ids) Promiseprivate Defined in addon/-private/system/store.js:688 This method makes a series of requests to the adapter's find method and returns a promise that resolves once they are all loaded. Parameters: modelName String ids Array Returns: Promise promise

DS.Store#findHasMany()

findHasMany (owner, link, relationship) Promiseprivate Defined in addon/-private/system/store.js:1032 If a relationship was originally populated by the adapter as a link (as opposed to a list of IDs), this method is called when the relationship is fetched. The link (which is usually a URL) is passed through unchanged, so the adapter can make whatever request it wants. The usual use-case is for the server to register a URL as a link, and then use that URL in the future to make a request for