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

Confusing API caching method names #29

Open
nickoneill opened this issue Aug 13, 2015 · 1 comment
Open

Confusing API caching method names #29

nickoneill opened this issue Aug 13, 2015 · 1 comment

Comments

@nickoneill
Copy link

Hey there,

I love awesomecache though I ran into something interesting the other day. I was looking at a cache I had written for some API and because of the naming convention for setObjectForKey("name", cacheBlock: {}, completion: {}, I thought I was never checking this cache for the object before I was running the cacheBlock. I realized how this actually works later when I referred to the github page again and I re-read the example: "If the cache already contains an object, the completion block is called with the cached object immediately."

This would probably be more clear if it was named checkObjectForKey or something similar. That better represents that the function doesn't just blindly run and set the object, but rather checks the cache and can hit completion immediately.

@lexrus
Copy link

lexrus commented Oct 26, 2015

Make sense. +1 for checkObjectForKey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants