-
Notifications
You must be signed in to change notification settings - Fork 77
Issue with offset #230
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
Comments
One possible solution would be to store returned items by params hash alongside Another idea is to store |
I fixed this in js-data, so it will be available in js-data-angular (angular-data 2.0). |
That was the solution. |
I've ran against an issue with this solution, when new items are added to storage, Suppose that
|
We can still optimise this a bit and only flush |
Here's how it works (assuming default settings). If the server has 10 items, then:
Now, you can manually eject the remaining items and the cached query with be flushed/invalidated. Or you can manually flush the query by doing this: // Force a new query to be made
DS.findAll('resource', { limit: 5 }, { bypassCache: true }) |
There is a problem with
offset
:Suppose that
resource
has no injected items, then by callingwe will get requested items injected to data store and our query cached. But if we call the same code again, the
DS.filter
function kicks in and will offset these 10 items in data store, thus returning empty array.See also #76
The text was updated successfully, but these errors were encountered: