Skip to content

Instantly share code, notes, and snippets.

@xjamundx
Last active August 29, 2015 14:16
Show Gist options
  • Save xjamundx/2aa720543b5963c3b9d8 to your computer and use it in GitHub Desktop.
Save xjamundx/2aa720543b5963c3b9d8 to your computer and use it in GitHub Desktop.
common data model

Backbone has models for both display state and server data. Views bind to models and respond to various events on the models.

Ampersand has have the concept of session data (for display stuff) and props (for server synced data) (http://read.humanjavascript.com/ch06-models.html)

Ember has controllers which "allow you to decorate your models with display logic" (http://emberjs.com/guides/controllers/)

React has state and props. State is local to the component (view) and props are immutable and passed down from a parent.

Relay Relay "By co-locating the queries with the view code...components can be moved anywhere in a render hierarchy without having to apply a cascade of modifications to parent components or to the server code which prepares the data payload." (http://facebook.github.io/react/blog/2015/02/20/introducing-relay-and-graphql.html)

Flux FLUX enforces a uni-directional data flow by not allowing any views to update any other models. Instead all components (views) listen to updates coming from stores and re-render on any change. To transmit updates the views send an event to the dispatcher, which will then handle updating the stores. It will do this in a way that avoids cascading affects....

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