Defined in: fixtures.js
- SproutCore 1.0
- fixtureForStoreKey(store, storeKey)
- generateIdFor(recordType, dataHash, store, storeKey)
- loadFixturesFor(store, recordType, ret)
- setFixtureForStoreKey(store, storeKey, dataHash)
Field Detaillatency Number
If you set
YES, then the fixtures source will
assume a response latency from your server equal to the msec specified
here. You should tune this to simulate latency based on the expected
performance of your server network. Here are some good guidelines:
- 500: Simulates a basic server written in PHP, Ruby, or Python (not twisted) without a CDN in front for caching.
- 250: (Default) simulates the average latency needed to go back to your origin server from anywhere in the world. assumes your servers itself will respond to requests < 50 msec
- 100: simulates the latency to a "nearby" server (i.e. same part of the world). Suitable for simulating locally hosted servers or servers with multiple data centers around the world.
- 50: simulates the latency to an edge cache node when using a CDN. Life is really good if you can afford this kind of setup.
YES then the data source will asynchronously respond to data requests
from the server. If you plan to replace the fixture data source with a
data source that talks to a real remote server (using Ajax for example),
you should leave this property set to YES so that Fixtures source will
more accurately simulate your remote data source.
If you plan to replace this data source with something that works with
local storage, for example, then you should set this property to
accurately simulate the behavior of your actual data source.
Instance Method Detail
- store SC.Store
- the store
- storeKey Number
- the storeKey
- data hash or null
Get the fixtures for the passed record type and prepare them if needed. Return cached value when complete.
- recordType SC.Record
- data hashes
Generates an id for the passed record type. You can override this if needed. The default generates a storekey and formats it as a string.
SC.MIXED_STATE if one or more of the
storeKeys can be
handled by the fixture data source.
Load fixtures for a given
fetchKey into the store
and push it to the ret array.