-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question documentation - combination of stores memory/rest #202
Comments
RequestMemory is really more of a one-time request and put into memory rather than a store with ongoing Rest operations. What you probably want is multiple stores, with a cache between them, similar to what was done in dojo/store. For example: var restStore = declare( [Rest, Trackable] );
var cachedStore = Cache.create(restStore, {
cachingStore: new Memory()
}); We should probably document this scenario better as its a common use case. |
fwiw, this is documented somewhat at https://github.com/SitePen/dstore/blob/master/docs/Stores.md#cache . Please let us know if you have suggestions on how we might make this more obvious @Jens-dojo . |
Dear Dylan, thank you for the prompt reply! |
Proposals for "Cache Store Mixin" docs
|
@Jens-dojo did you get this sorted out? i can get caching to work but not tracking using declare([ Rest, Cache, SimpleQuery, Trackable ]) |
Hi, I checked my source code (it is so long ago that I wrote it). I have two combinations in my source code that I use. So these seem to work for me: define( [
'dojo/_base/declare', 'dstore/Rest','dstore/Trackable','dstore/Cache'],
function(declare,Rest,Trackable,Cache) {
return declare([ Rest, Cache, Trackable ], {
idProperty : 'uniqueid',
postscript: function () {
this.inherited(arguments);
this.fetch();
},
isValidFetchCache: true
});
} ); and define( [
'dojo/_base/declare', 'dstore/RequestMemory',
'dstore/Trackable'
], function(declare,RequestMemory,Trackable) {
return declare( [
RequestMemory, Trackable
], {
idProperty : 'uniqueid'
} );
} ); |
Hello,
the documentation has really become very good. But I am struggling when it comes to combine stores.
I need
Fetch and get/put/delete/post done by REST.
What would be the correct combination?
declare( [Rest, RequestMemory, Trackable])
Thank you for your help!!
The text was updated successfully, but these errors were encountered: