Webpack 2 split in multiple config files and ReactJs
This is a simple example of ReactJS using Redux Thunk and Redux Saga
$ npm install
If you want to run the project using Redux thunk you can just start the app as by default is using thunk
$ npm run start
To use Redux Saga you will need to make changes in 2 files
and
In
Uncomment the activeStore = SagaStore and comment the line where activeStore=Store
...
// const activeStore = Store;
const activeStore = SagaStore;
In
Comment line this.props.fetchApodData(); and uncomment line this.props.fetchApodDataSaga();
...
componentDidMount() {
// If the data is NOT fetched then go
if (!this.props.dataFetched) {
// With REDUX THUNK
// this.props.fetchApodData();
// With REDUX SAGA
this.props.fetchApodDataSaga();
}
}
...
Then run the project
$ npm run start