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

backbonify explore and explore-collection #160

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

Conversation

ProCynic
Copy link
Contributor

change explore-page and explore-collection-page to use backbone collections.

A single array of product objects has been replaced with three backbone
collections.  In the dom we now also have three ul elements backed by three
products-list components.  Instead of modifying the products array and
rerendering when switching from e.g. popular to nearby we now hide popular
and show nearby.  This not only means that we can cache the views to avoid
unnecessary re-rendering, we also replaced a single object of mutable state
with three objects which are semantically static.

The backbone collections also provide a much better platform for events.

The framework of the explore page (i.e. the header), now only renders once on
initialize instead of rerendering every time the products change.

The products-list component will now listen to events on its collection instead
of waiting for its owner to manually call render.  The products-list will also
now append views to the dom when models are added to its collection, as opposed
to rerendeing them all every time as it does now.

The search and pagination haven't been updated yet, but they should be working
again soon.
@ProCynic
Copy link
Contributor Author

  • collection reset on user auth
  • apply changes to explore-collection
  • backbonify my collections

@ProCynic
Copy link
Contributor Author

couple more things.

@ProCynic
Copy link
Contributor Author

  • add to collection on product feeling
  • remove user.setKeytag
  • reduce refetching of collections.

@@ -125,7 +125,7 @@
}

, app = {
init: function(){
init: utils.partial(require, ['./models/sync'], function(){
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm particularly proud of this one.

@ProCynic
Copy link
Contributor Author

@jrf0110 @prestonp rfr. god speed.

@ProCynic
Copy link
Contributor Author

try this:

  1. find a product that's in a collection on the explore page.
  2. like it. watch the like count change
  3. open the modal. check the feeling state and the like count.
  4. open it's collection. check the feeling state and the like count.

@ghost ghost assigned ProCynic Aug 1, 2013
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.

1 participant