-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added support for providers implementing async load and clear methods. #16
base: master
Are you sure you want to change the base?
Added support for providers implementing async load and clear methods. #16
Conversation
var value = storageProvider.getItem(nskey(key)); | ||
setCache(key, value); // Build cache and publish an "added" events. | ||
}); | ||
originalPublish(EventName.ready); // Publish even if options.publish is false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
76759d7
to
cefbf88
Compare
🎱 See comments. |
7e6e4d7
to
c596d42
Compare
throwIfUninitialized = _.noop; // Allow other methods to work without throwing. | ||
if (storageProvider.load) { // If provider implements load() - use it. | ||
asyncLoad(); | ||
} else { // If prvider does not implement load(), data is loaded using a series of getItem calls. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
c596d42
to
239f9a4
Compare
that.load = function () { | ||
if (storageProvider.load) { // If provider implements load() - use it. | ||
asyncLoad(); | ||
} else { // If prvider does not implement load(), data is loaded using a series of getItem calls. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
239f9a4
to
5dd56fa
Compare
|
||
function asyncClear() { | ||
storageProvider.clear(namespace).done(function () { | ||
var publishReady = initialize(); // Initialize only if needed and return true if initalization was performed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
Looks good to me. I'd like to @donavon to take a look when he can. |
👍 |
No description provided.