Skip to content

Commit

Permalink
Removing recompose package and installing redux-devtools-extension
Browse files Browse the repository at this point in the history
  • Loading branch information
deniolp committed Nov 27, 2019
1 parent c4384bd commit 3990c36
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 108 deletions.
114 changes: 13 additions & 101 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"jest": "24.9.0",
"react-router-dom": "5.1.2",
"react-test-renderer": "16.10.2",
"redux-devtools-extension": "2.13.8",
"stylelint-config-htmlacademy": "0.1.4",
"typescript": "3.7.2",
"utility-types": "3.10.0",
Expand All @@ -43,7 +44,6 @@
"react": "16.10.2",
"react-dom": "16.10.2",
"react-redux": "7.1.1",
"recompose": "0.30.0",
"redux": "4.0.4",
"redux-mock-store": "1.5.3",
"redux-thunk": "2.3.0"
Expand Down
8 changes: 2 additions & 6 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,20 @@ import {BrowserRouter} from 'react-router-dom';
import {createStore, applyMiddleware} from 'redux';
import {Provider} from 'react-redux';
import thunk from 'redux-thunk';
import {compose} from 'recompose';
import {composeWithDevTools} from 'redux-devtools-extension';

import App from './components/app/app';
import {reducer, Operation} from './reducer/reducer';
import createAPI from './api';

let store;
declare const __REDUX_DEVTOOLS_EXTENSION__: () => any;

const init = () => {
const api = createAPI((...args) => store.dispatch(...args));

store = createStore(
reducer,
compose(
applyMiddleware(thunk.withExtraArgument(api)),
__REDUX_DEVTOOLS_EXTENSION__ ? __REDUX_DEVTOOLS_EXTENSION__() : (f) => f
));
composeWithDevTools(applyMiddleware(thunk.withExtraArgument(api))));

store.dispatch(Operation.loadPromoFilm());
store.dispatch(Operation.loadFilms());
Expand Down

0 comments on commit 3990c36

Please sign in to comment.