Right now I'm setting data that i need to access frequently via these dataStore() objects. This isn't very clean and no clear docs on what is and isn't stored.
I think there needs to be two types of data retrieval:
app().get()
This would allow for some predetermined parameters which would be [method]-[type], for example previous-session or active-item.
Methods:
previous
active
next
Types:
agenda
session
item
This would either return undefined if it didn't exist, or the ID of the corresponding type. These should be stored and updated behind the scenes so that no AJAX request would need to take place and no need for a callback.
//so you can do:
var lastItem = app().get('last-item');
//rather than:
app().get('last-item',function(item){
var lastItem = item;
});
app().store()
This is much more flexible and is sort of like localStorage (in fact, it very well could be behind the scenes). It'd work like:
Open to suggestions on any of this, but this will be very helpful in the future. dataStore() has already caused issues for @earenson and me when I was trying to check for the last item and broke a personal rule of mine not to use the DOM as a means of checking/storing data.
Right now I'm setting data that i need to access frequently via these
dataStore()
objects. This isn't very clean and no clear docs on what is and isn't stored.I think there needs to be two types of data retrieval:
app().get()
This would allow for some predetermined parameters which would be [method]-[type], for example
previous-session
oractive-item
.Methods:
previous
active
next
Types:
agenda
session
item
This would either return
undefined
if it didn't exist, or the ID of the corresponding type. These should be stored and updated behind the scenes so that no AJAX request would need to take place and no need for a callback.app().store()
This is much more flexible and is sort of like localStorage (in fact, it very well could be behind the scenes). It'd work like:
Open to suggestions on any of this, but this will be very helpful in the future. dataStore() has already caused issues for @earenson and me when I was trying to check for the last item and broke a personal rule of mine not to use the DOM as a means of checking/storing data.