-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial work on composition-based flow
- Loading branch information
BinaryMuse
committed
May 1, 2015
1 parent
b35d28b
commit f331505
Showing
12 changed files
with
340 additions
and
144 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,28 @@ | ||
var React = require("react"), | ||
Router = require("react-router"), | ||
RouteHandler = Router.RouteHandler, | ||
Link = Router.Link, | ||
Fluxxor = require("../../../../"); | ||
Link = Router.Link; | ||
|
||
var RecipeList = React.createClass({ | ||
mixins: [Fluxxor.FluxMixin(React), Fluxxor.StoreWatchMixin("recipe")], | ||
|
||
getStateFromFlux: function() { | ||
return { | ||
recipes: this.getFlux().store("recipe").getRecipes() | ||
}; | ||
}, | ||
|
||
render: function() { | ||
class RecipeList extends React.Component { | ||
render() { | ||
return ( | ||
<div> | ||
<h1>Recipes</h1> | ||
<ul>{this.state.recipes.map(this.renderRecipeLink)}</ul> | ||
<ul>{this.props.recipes.map(this.renderRecipeLink)}</ul> | ||
<div> | ||
<Link to="add-recipe">Add New Recipe</Link> | ||
</div> | ||
</div> | ||
); | ||
}, | ||
} | ||
|
||
renderRecipeLink: function(recipe) { | ||
renderRecipeLink(recipe) { | ||
return ( | ||
<li key={recipe.id}> | ||
<Link to="recipe" params={{id: recipe.id}}>{recipe.name}</Link> | ||
</li> | ||
); | ||
} | ||
}); | ||
}; | ||
|
||
module.exports = RecipeList; |
This file contains 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
Oops, something went wrong.