Answer the question
In order to leave comments, you need to log in
How does applyMiddleware work?
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import promiseMiddleware from 'redux-promise'
import Routes from './routes';
const createStoreWithMiddleware = applyMiddleware(promiseMiddleware)(createStore);
console.log(createStoreWithMiddleware);
ReactDOM.render(
<Provider store={createStoreWithMiddleware}>
<BrowserRouter>
<Routes />
</BrowserRouter>
</Provider>
, document.getElementById('root'));
const createStoreWithMiddleware = applyMiddleware(promiseMiddleware)(createStore);
Answer the question
In order to leave comments, you need to log in
What exactly is not clear how ()() works?
Is this notation understandable?
function sum(x) {
return function(y) {
return x+y
}
}
sum(1)(2) // 3
sum(1) // Function
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question