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

Added support for providers implementing async load and clear methods. #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zjordan
Copy link

@zjordan zjordan commented Jan 12, 2016

No description provided.

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

@zjordan zjordan force-pushed the p/zj/add-support-for-providers-implementing-async-load-method branch from 76759d7 to cefbf88 Compare January 12, 2016 17:24
@pbouzakis
Copy link
Collaborator

🎱 See comments.

@zjordan zjordan force-pushed the p/zj/add-support-for-providers-implementing-async-load-method branch from 7e6e4d7 to c596d42 Compare January 12, 2016 19:44
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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

@zjordan zjordan force-pushed the p/zj/add-support-for-providers-implementing-async-load-method branch from c596d42 to 239f9a4 Compare January 12, 2016 19:50
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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

@zjordan zjordan force-pushed the p/zj/add-support-for-providers-implementing-async-load-method branch from 239f9a4 to 5dd56fa Compare January 12, 2016 20:00

function asyncClear() {
storageProvider.clear(namespace).done(function () {
var publishReady = initialize(); // Initialize only if needed and return true if initalization was performed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

@pbouzakis
Copy link
Collaborator

Looks good to me. I'd like to @donavon to take a look when he can.

@donavon
Copy link
Owner

donavon commented Feb 1, 2016

👍

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

Successfully merging this pull request may close these issues.

4 participants