An mini application with React and Redux
git clone https://github.com/franxyzxyz/mediawiki-with-react-redux.git
cd mediawiki-with-react-redux
npm install
npm start
.
├── app.js
├── node_modules
├── package.json
├── src
├── app
├── actions
├── components
├── containers
├── fonts
├── index.jsx
├── reducers
├── styles
└── utilities
└── build
├── assets
├── bundle.js
└── index.html
└── webpack.config.js
The application follows:
Presentational
dispatch
dispatch
[update state]
connect()
Rooted from a background as an Angular 1.x Developer, the React/Redux combination was completely off $scope at first, as of one-way binding.
However, the dataflow with this combo was more obvious with the present of a giant 'state tree' in the single store. They in fact share some similarities in concepts despite the huge base-line differences in doing the same thing:
eg. Angular: $rootScope.$broadcast('hello') for manually
broadcasting changes for cross-controller communication
Redux: dispatch(hello()) => state is changed
The problem with CORS persisted using 'isomorphic-fetch', and cannot be solved with allowing cross-origin header or with params { mode: 'cors'} during the fetch. It was eventually solved by a hacky way on requesting JSONP instead.