-
Notifications
You must be signed in to change notification settings - Fork 1
Data Storage
mpetrovic edited this page May 12, 2011
·
5 revisions
Extension Stores all raw data, as well as provides mechanism for loading data on the fly.
Properties:
- data -- a plain JS object. Data should be broken up by types first, then by a unique-ish machine name identifier. Example:
- data.npc.soldier_01.all_his_stats
- data.background.level_01a.some_stuff
- data.music.city_central.some_stuff
- url -- where your store is located externally. will be loaded with ajax. or ajaj. or ajah if you really want. I would suggest the server result be JSON, though.
- prepare(type, id, url) -- starts loading data from the server. url is optional.
- process(type, id) -- callback. takes the result of prepare and puts it into the cache
- get(type, id) -- gets data from the local cache
- create(type, id) -- creates an entity of the given type and id. alias for get?