File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 2020 "react" : " ^0.13.3" ,
2121 "react-router" : " ^1.0.0-beta2" ,
2222 "reactify" : " ^1.1.0" ,
23+ "reflux" : " ^0.2.8" ,
2324 "vinyl-source-stream" : " ^1.1.0" ,
2425 "watchify" : " ^2.4.0" ,
2526 "whatwg-fetch" : " ^0.9.0"
Original file line number Diff line number Diff line change 11var React = require ( 'react' ) ;
2+ var Api = require ( '../utils/api' ) ;
23
34module . exports = React . createClass ( {
5+ getInitialState : function ( ) {
6+ return {
7+ topics : [ ]
8+ }
9+ } ,
10+ componentWillMount : function ( ) {
11+ Api . get ( 'topics/defaults' )
12+ . then ( function ( data ) {
13+ this . setState ( {
14+ topics : data . data
15+ } )
16+ } . bind ( this ) ) ;
17+ } ,
418 render : function ( ) {
519 return < div className = "list-group" >
620 Topic List
21+ { this . renderTopics ( ) }
722 </ div >
23+ } ,
24+ renderTopics : function ( ) {
25+ return this . state . topics . map ( function ( topic ) {
26+ return < li >
27+ { topic }
28+ </ li >
29+ } ) ;
830 }
9- } )
31+ } ) ;
You can’t perform that action at this time.
0 commit comments