- Using "native" fetch with
babel-polyfill - "Register" the polyfill via
require,importor inwebpack.config.js
npm install babel-polyfill --save-devmodule.exports = {
entry: ['babel-polyfill', './src/app.js'],
};fetch('http://localhost:8080/posts')
.then(response => response.json)
.then(data => this.setState({ content: data.content }))
.catch(error => this.setState({ error: error.message }));- Async dispatching Redux Action-Creator