Skip to content
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

Remove all caches #37

Closed
dmitrybelyakov opened this issue Sep 3, 2013 · 6 comments
Closed

Remove all caches #37

dmitrybelyakov opened this issue Sep 3, 2013 · 6 comments
Assignees
Labels
Milestone

Comments

@dmitrybelyakov
Copy link

Hi there!

It might be nice to have an option to clear all caches without calling each one by name.
I think I can wrap cache factory to keep track of all the created caches but maybe there is such an option already?

@jmdobry
Copy link
Owner

jmdobry commented Sep 3, 2013

$cacheFactory has limited functionality, and no ability to remove all caches at once.

With $angularCacheFactory you could do the following to clear all caches:

var keySet = $angularCacheFactory.keySet();
for (var key in keySet) {
  $angularCacheFactory.get(key).removeAll();
}

or

var keySet = $angularCacheFactory.keySet();
for (var key in keySet) {
  $angularCacheFactory.get(key).destroy();
}

@dmitrybelyakov
Copy link
Author

Yes, I was reffering to angularCacheFactory. Thanks for the tip and an awesome lib!

@jmdobry
Copy link
Owner

jmdobry commented Sep 3, 2013

No problem!

Do you think it is worth it to add removeAll() and clearAll() to the $angularCacheFactory object?

@blaster151
Copy link

Yes, please (in my opinion)! :)

On Tuesday, September 3, 2013, Jason Dobry wrote:

No problem!

Do you think it is worth it to add removeAll() and clearAll() to the
$angularCacheFactory object?


Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-23724905
.

@jmdobry
Copy link
Owner

jmdobry commented Sep 3, 2013

K. They should make it into v1.1.0.

@dmitrybelyakov
Copy link
Author

Yes and thank you. That would be quite convenient :)

@ghost ghost assigned jmdobry Sep 3, 2013
jmdobry added a commit that referenced this issue Sep 3, 2013
@jmdobry jmdobry closed this as completed Sep 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants