-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flux - 28 - Fetching Single Records from a Store
- Loading branch information
1 parent
e606fad
commit 2528ac5
Showing
2 changed files
with
20 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
var React = require('react'); | ||
var Reflux = require('reflux'); | ||
var ImageStore = require('../stores/image-store'); | ||
|
||
module.exports = React.createClass({ | ||
mixins: [ | ||
Reflux.listenTo(ImageStore, 'onChange') | ||
], | ||
render: function() { | ||
return <div> | ||
I am an image detail. | ||
</div> | ||
}, | ||
onChange: function(event, image) { | ||
this.setState({ | ||
image: image | ||
}); | ||
} | ||
}); |
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