Full Stack, March 12, 2015
You can see the final product on the finished
branch.
-
Clone this repo and go to it:
cd ~/code # or wherever you keep code git clone [email protected]:fullstacktalks/react-flux-starter.git cd react-flux-starter
-
Start a web server:
python -m SimpleHTTPServer 8000
-
Open the project in a browser (
http://localhost:8000/lab/
): -
Open the project in your code editor.
- Display the currently selected city. You'll need to:
- Create a new React component called
Display
- Render that component into
#display
- Make the component read its state from
SelectedValueStore
- Make the component listen for changes from
SelectedValueStore
- Display the number of times a selection has been made. You'll need to:
- Add a new store for this value,
SelectionCountStore
- Make the store listen for
VALUE_WAS_SELECTED
in the dispatcher - Use those events to update the store's value and update subscribers
- Display that value in your new component