Created
April 13, 2015 13:57
-
-
Save nambrot/bb2b5aae8d1efe16adb7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app.js | |
flux = new Flux() | |
flux.deserialize(window.serializedStoreState) if window.serializedStoreState | |
Router.run routes, Router.HistoryLocation, (Handler, state) -> | |
handler = <FluxComponent flux={flux} render={ => <Handler />}></FluxComponent> | |
React.render(handler, document.getElementById("main")) | |
# stores/post.coffee | |
class PostsStore extends Store | |
@deserialize: (serializedState) -> | |
if serializedState | |
posts: getPostsFromJSON(JSON.parse(serializedState.serializedPosts)) | |
didFetchAll: serializedState.didFetchAll | |
else | |
getDefaultState() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment