Skip to content

Instantly share code, notes, and snippets.

@jdiaz5513
Created January 16, 2015 18:24
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdiaz5513/6716e23c4995711db020 to your computer and use it in GitHub Desktop.
Save jdiaz5513/6716e23c4995711db020 to your computer and use it in GitHub Desktop.
Linked collection state for ampersand-state
@jdiaz5513
Copy link
Author

Example:

var CarDealer = AmpersandState.extend(linkCollectionStateMixin, {
  collections: {
    carLot: Cars
  },

  initialize: function() {
    this.linkCollectionState('carLot', 'lastSoldCar', 'lastSoldCarId');
  },

  props: {
    lastSoldCarId: 'number'
  },

  session: {
    lastSoldCar: 'state'
  }
});

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