Created
December 9, 2014 00:40
-
-
Save flarnie/f548a6bca509194618eb to your computer and use it in GitHub Desktop.
Flux TodoApp Sample 1
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
// Loading the initial data into the application: | |
// ... | |
/** | |
* Retrieve the current TODO data from the TodoStore | |
*/ | |
function getTodoState() { | |
return { | |
allTodos: TodoStore.getAll(), | |
areAllComplete: TodoStore.areAllComplete() | |
}; | |
} | |
var TodoApp = React.createClass({ | |
getInitialState: function() { | |
return getTodoState(); | |
}, | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Suggestion, change
to
Thinking about functions as values can help cleaning up a lot of Javascript code.