Added support for "before" for Memory and Rest #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there,
This implements #6 for Memory.js and for Rest.js.
Two issues:
In Rest.js I set "null" for the X-rest-before header. Ideally, the header should be left empty (that is, when the server sees that the X-rest-before header is there but it's empty, it means "place at the end"). However, Dojo doesn't allow empty headers (they are taken out):
https://github.com/dojo/dojo/blob/master/request/xhr.js#L205-L212
In Cache.js, in
put()
an item is always deleted and then added again:https://github.com/SitePen/dstore/blob/master/Cache.js#L149-L158
This means that even though my implementation of Memory moves as little as possible, it ends up always moving the item from its last position when using Memory.js as the caching store
Thanks for listening as ever!
Merc.