To use the all new awesome ES6 syntax:
Let’s add that.
-
Install the dependencies npm install babel-core babel-loader babel-preset-env --save-dev
-
Create and configure a .babelrc
{ "presets": [ "env" ] }
-
Tell webpack to use babel-loader to allow ES6 syntax. You can either add this as an argument in your package.json, like below:
"scripts": { "dev": "webpack --mode development --module-bind js=babel-loader", "build": "webpack --mode production --module-bind js=babel-loader" } OR, create a webpack.config.js
module.exports = { module: { rules: [ { test: /.js$/, exclude: /node_modules/, use: { loader: "babel-loader" } } ] } }
- The Redux store is like a brain: it’s in charge for orchestrating all the moving parts in Redux
- The state of the application lives as a single, immutable object within the store
- As soon as the store receives an action it triggers a reducer
- The reducer returns the next state
- Using concat(), slice(), and …spread for arrays
- Using Object.assign() and …spread for objects