{"action":"opened","issue":{"url":"https://api.github.com/repos/js-data/js-data/issues/167","labels_url":"https://api.github.com/repos/js-data/js-data/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/js-data/js-data/issues/167/comments","events_url":"https://api.github.com/repos/js-data/js-data/issues/167/events","html_url":"https://github.com/js-data/js-data/issues/167","id":91310370,"number":167,"title":"DS#refreshAll","user":{"login":"kentcdodds","id":1500684,"avatar_url":"https://avatars.githubusercontent.com/u/1500684?v=3","gravatar_id":"","url":"https://api.github.com/users/kentcdodds","html_url":"https://github.com/kentcdodds","followers_url":"https://api.github.com/users/kentcdodds/followers","following_url":"https://api.github.com/users/kentcdodds/following{/other_user}","gists_url":"https://api.github.com/users/kentcdodds/gists{/gist_id}","starred_url":"https://api.github.com/users/kentcdodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentcdodds/subscriptions","organizations_url":"https://api.github.com/users/kentcdodds/orgs","repos_url":"https://api.github.com/users/kentcdodds/repos","events_url":"https://api.github.com/users/kentcdodds/events{/privacy}","received_events_url":"https://api.github.com/users/kentcdodds/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-26T17:25:02Z","updated_at":"2015-06-26T17:25:02Z","closed_at":null,"body":"Would love to be able to refresh items in the datastore based on a params. Here's the chat in gitter that sparked this idea:\r\n\r\n> Hey friends. I need to refresh all resources that match a particular filter. For example: {accountId: '123'}.\r\n> The way I think to accomplish this would be to do something like:\r\n> ```javascript\r\n> const params = {accountId: '123};\r\n> User.ejectAll(params);\r\n> User.findAll(params)\r\n> ```\r\n> Or something like that..\r\n> The problem is. While that request is in flight, for anything that's bound to the users in the datastore (and watching for changes in the datastore) we'll have a flicker while we're waiting for the request.\r\n> so there could be 10 users, then 0 for a second, then 10 again or something like that\r\n> is there a smart hook that I could use to eject the right things from the datastore right before the new ones are injected?\r\n> I need this to be applicable to more than just users and the params can be different in different scenarios...\r\n> I could also not eject anything and just save a copy of all of the IDs in the datastore, then when the stuff comes back, I could eject everything, do a diff and then re-inject the stuff that should still be around... But that seems hacky...\r\n> I'm hoping there's a better way.\r\n> Would love to get a refreshAll thing which does this for me\r\n\r\nI'm implementing this in my own project. I'll post my code when I get that finished. Perhaps it could be useful when this is implemented (by me, or some other OSS loving soul)."}}