Skip to content

Instantly share code, notes, and snippets.

@jhollingworth
Created May 18, 2015 14:58
Show Gist options
  • Save jhollingworth/994482748e1398920e81 to your computer and use it in GitHub Desktop.
Save jhollingworth/994482748e1398920e81 to your computer and use it in GitHub Desktop.
var UserStore = Marty.createStore({
id: 'UserStore',
getInitialState() {
return Immutable.Map()
},
dehyrdate() {
return this.state.toJS()
},
rehyrdate(state) {
this.replaceState(Immutable.fromJS(state))
}
})
Marty.dehyrdate() => // { UserStore: { state: { ... } }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment