Simple demo application using Esri's JavaScript API and React. It also shows how to use the Flux architecture in a map based application. This is using a naive implementation of flux I wrote myself based off of React's TODO MVC example, it's good at demonstrating the concepts of Flux but is by no means intended to be a Flux library. It would work perfectly fine in production on a simple app but once your app gets larger and has multiple stores, especially stores that depend on each other, you may want to use something like Alt which has waitsFor
in the dispatcher as well as other extras and is much more battle tested.
The Demo is currently using the react-motion branch.
http://robert-w.github.io/esri-flux-react/
This project requires node.js and bower.
- Run (may need sudo depending on how you installed node):
npm install
- Run:
bower install
Run: npm start
This will compile all stylus, jade, and es6 modules, and it's using babel for es6 modules so it will compile JSX for you as well.
Run: npm run dist
Generates a minified build using a custom prerender script, requirejs optimizer, babel, stylus, jade, and gulp in a dist folder. After running, you can look at the index.html source and you will notice a big string of React markup generated from prerender.js.
Check out the react-motion branch. Instead of using css animations on the basemap gallery it is using react-motion by @chenglou, I like this version much better and it will soon be merged in to master :)
Build commands may trip up on windows, there is an npm run distWin
which can be used for a custom build on windows.