{"action":"closed","issue":{"url":"https://api.github.com/repos/jmdobry/CacheFactory/issues/6","labels_url":"https://api.github.com/repos/jmdobry/CacheFactory/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/jmdobry/CacheFactory/issues/6/comments","events_url":"https://api.github.com/repos/jmdobry/CacheFactory/issues/6/events","html_url":"https://github.com/jmdobry/CacheFactory/issues/6","id":115282606,"number":6,"title":"Allow async implementation of cache interface","user":{"login":"jrencz","id":948356,"avatar_url":"https://avatars.githubusercontent.com/u/948356?v=3","gravatar_id":"","url":"https://api.github.com/users/jrencz","html_url":"https://github.com/jrencz","followers_url":"https://api.github.com/users/jrencz/followers","following_url":"https://api.github.com/users/jrencz/following{/other_user}","gists_url":"https://api.github.com/users/jrencz/gists{/gist_id}","starred_url":"https://api.github.com/users/jrencz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrencz/subscriptions","organizations_url":"https://api.github.com/users/jrencz/orgs","repos_url":"https://api.github.com/users/jrencz/repos","events_url":"https://api.github.com/users/jrencz/events{/privacy}","received_events_url":"https://api.github.com/users/jrencz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-05T13:21:50Z","updated_at":"2015-11-05T16:24:17Z","closed_at":"2015-11-05T16:24:17Z","body":"I tried to connect `angular-cache` with [ocombe/angular-localForage](https://github.com/ocombe/angular-localForage) (in general - `CacheFactory` and [mozilla/localForage](https://github.com/mozilla/localForage)) but it turns out that async storge implementation is not supported by `CacheFactory `. For example [index.js#L417-L420](https://github.com/jmdobry/CacheFactory/blob/89de7d121d1450442af55ba2975ce235d89496f3/src/index.js#L417-L420):\r\n\r\n```js\r\n$$storage().removeItem(this.$$prefix + '.data.' + key);\r\nvar keysJson = $$storage().getItem(this.$$prefix + '.keys');\r\nvar keys = keysJson ? utils.fromJson(keysJson) : [];\r\nvar index = keys.indexOf(key);\r\n```\r\n\r\nthis clearly does not allow `removeItem` and `getItem` to return promises.\r\n\r\n@jmdobry are you interested in implementing async storage in `CacheFactory`? Do you see any obvious cons for this idea?"}}