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

Fixes #133, creates API for Maps and Lists for consistent data checking #154

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

Conversation

imjoshdean
Copy link

@imjoshdean imjoshdean commented Sep 27, 2016

For #133:

If can/map is being used alongside fall-through-cache, new attributes will be added to Maps and Lists.

  • isConsistent() will return true if the data is actively in sync with the data from the server, false if it's relying on fall-back-cache's cached data.
  • inconsistencyReason will return the base connection's rejected promise error, should there be one.

// what do we do here? self.rejectedUpdatedList ?
console.log("REJECTED", e);
console.error("baseConnect.getListData rejected", e);
self.rejectedUpdatedInstance(list, e);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be rejectedUpdatedList?

Copy link
Author

Choose a reason for hiding this comment

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

I don't, "instance" was the best neutral name I could come up with to apply to both a map and a list.


var behavior = {
init: function() {
// If List and Map are on the behavior, then we go ahead and add the
// isConsistent API information.
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably avoid having fall-through-cache know anything about can-connect/can/map. Can you think of a way to avoid this?

Copy link
Author

Choose a reason for hiding this comment

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

Off the top of my head no. Based on the suggested requirements, these features would be specific to maps and lists, and made sense to me that if we wanted to have these function features available in templates.

Do you have any suggestions?

@justinbmeyer
Copy link
Contributor

Thanks @imjoshdean. Please let me know if you have any thoughts about this stuff.

@imjoshdean
Copy link
Author

Thoughts provided inline!

@matthewp
Copy link
Contributor

@justinbmeyer this is waiting review.

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

Successfully merging this pull request may close these issues.

3 participants