{"action":"closed","issue":{"url":"https://api.github.com/repos/VictorAlbertos/ReactiveCache/issues/2","repository_url":"https://api.github.com/repos/VictorAlbertos/ReactiveCache","labels_url":"https://api.github.com/repos/VictorAlbertos/ReactiveCache/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/VictorAlbertos/ReactiveCache/issues/2/comments","events_url":"https://api.github.com/repos/VictorAlbertos/ReactiveCache/issues/2/events","html_url":"https://github.com/VictorAlbertos/ReactiveCache/issues/2","id":168609507,"number":2,"title":"Evicting group cache in Read.me","user":{"login":"AlexBlokh","id":4045375,"avatar_url":"https://avatars.githubusercontent.com/u/4045375?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexBlokh","html_url":"https://github.com/AlexBlokh","followers_url":"https://api.github.com/users/AlexBlokh/followers","following_url":"https://api.github.com/users/AlexBlokh/following{/other_user}","gists_url":"https://api.github.com/users/AlexBlokh/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexBlokh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexBlokh/subscriptions","organizations_url":"https://api.github.com/users/AlexBlokh/orgs","repos_url":"https://api.github.com/users/AlexBlokh/repos","events_url":"https://api.github.com/users/AlexBlokh/events{/privacy}","received_events_url":"https://api.github.com/users/AlexBlokh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-01T09:58:01Z","updated_at":"2016-08-08T12:15:35Z","closed_at":"2016-08-08T12:15:35Z","body":"Probably, you should evict all groups cache here when pull to refresh\r\n```java\r\n   Observable<List<Event>> events(boolean pullToRefresh, int page) {\r\n      if (pullToRefresh) {\r\n        // evict all caches, not only for the current page\r\n        return apiEvents.events(page)\r\n            .compose(cacheProvider.replace(page));\r\n      }\r\n```\r\n\r\n```java\r\nclass EventsRepository {\r\n    private final ProviderGroup<List<Event>> cacheProvider;\r\n    private final ApiEvents apiEvents;\r\n\r\n    EventsRepository(ApiEvents apiEvents, ReactiveCache reactiveCache) {\r\n      this.apiEvents = apiEvents;\r\n      this.cacheProvider = reactiveCache.<List<Event>>providerGroup()\r\n          .withKey(\"events\");\r\n    }\r\n\r\n    Observable<List<Event>> events(boolean pullToRefresh, int page) {\r\n      if (pullToRefresh) {\r\n        return apiEvents.events(page)\r\n            .compose(cacheProvider.replace(page));\r\n      }\r\n\r\n      return apiEvents.events(page)\r\n          .compose(cacheProvider.readWithLoader(page));\r\n    }\r\n  }\r\n```\r\n\r\n"}}
{"actor":{"display_login":"VictorAlbertos"}}