remove react-router-redux

This commit is contained in:
ValeraS
2018-09-12 15:58:08 +03:00
committed by Mrugesh Mohapatra
parent 5dcd9524ad
commit 87b8b13bef
5 changed files with 10 additions and 52 deletions

View File

@ -7,11 +7,10 @@ import headComponents from './src/head';
import { createStore } from './src/redux/store';
export const replaceRenderer = ({
history,
bodyComponent,
replaceBodyHTMLString
}) => {
const store = createStore(history);
const store = createStore();
const ConnectedBody = () => (
<Provider store={store}>{bodyComponent}</Provider>

View File

@ -45,7 +45,6 @@
"react-monaco-editor": "^0.18.0",
"react-redux": "^5.0.7",
"react-reflex": "^2.2.1",
"react-router-redux": "^5.0.0-alpha.9",
"react-spinkit": "^3.0.0",
"react-stripe-elements": "^2.0.0",
"react-test-renderer": "^16.3.1",

View File

@ -4,7 +4,6 @@ import {
applyMiddleware
} from 'redux';
import { combineEpics, createEpicMiddleware } from 'redux-observable';
import { routerReducer as router, routerMiddleware } from 'react-router-redux';
import { reducer as formReducer } from 'redux-form';
@ -27,8 +26,7 @@ const rootReducer = combineReducers({
app,
challenge,
form: formReducer,
map,
router
map
});
const rootEpic = combineEpics(...appEpics, ...challengeEpics);
@ -42,8 +40,8 @@ const epicMiddleware = createEpicMiddleware(rootEpic, {
}
});
export const createStore = history =>
export const createStore = () =>
reduxCreateStore(
rootReducer,
applyMiddleware(epicMiddleware, routerMiddleware(history))
applyMiddleware(epicMiddleware)
);

View File

@ -6,10 +6,11 @@ import {
map,
catchError,
concat,
filter
filter,
tap
} from 'rxjs/operators';
import { ofType } from 'redux-observable';
import { push } from 'react-router-redux';
import { navigate } from 'gatsby';
import { _csrf as csrfToken } from '../../../redux/cookieVaules';
@ -137,7 +138,6 @@ export default function completionEpic(action$, { getState }) {
const meta = challengeMetaSelector(state);
const { isDonating } = userSelector(state);
const { nextChallengePath, introPath, challengeType } = meta;
const next = of(push(introPath ? introPath : nextChallengePath));
const showDonate = isDonating ? empty() : shouldShowDonate(state);
const closeChallengeModal = of(closeModal('completion'));
let submitter = () => of({ type: 'no-user-signed-in' });
@ -155,7 +155,7 @@ export default function completionEpic(action$, { getState }) {
}
return submitter(type, state).pipe(
concat(next),
tap(() => navigate(introPath ? introPath : nextChallengePath)),
concat(closeChallengeModal),
concat(showDonate),
filter(Boolean)

View File

@ -5391,16 +5391,6 @@ hex-color-regex@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e"
history@^4.7.2:
version "4.7.2"
resolved "https://registry.yarnpkg.com/history/-/history-4.7.2.tgz#22b5c7f31633c5b8021c7f4a8a954ac139ee8d5b"
dependencies:
invariant "^2.2.1"
loose-envify "^1.2.0"
resolve-pathname "^2.2.0"
value-equal "^0.4.0"
warning "^3.0.0"
hmac-drbg@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
@ -5421,7 +5411,7 @@ hoist-non-react-statics@^1.0.5:
version "1.2.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"
hoist-non-react-statics@^2.3.0, hoist-non-react-statics@^2.5.0:
hoist-non-react-statics@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz#d2ca2dfc19c5a91c5a6615ce8e564ef0347e2a40"
@ -6972,7 +6962,7 @@ loop-protect@^2.1.6:
version "2.1.6"
resolved "https://registry.yarnpkg.com/loop-protect/-/loop-protect-2.1.6.tgz#03840f79591121c37a53a87fb9aff2841e488c2d"
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1:
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
@ -9005,26 +8995,6 @@ react-reflex@^2.2.1:
prop-types "^15.5.8"
react-measure "^2.0.2"
react-router-redux@^5.0.0-alpha.9:
version "5.0.0-alpha.9"
resolved "https://registry.yarnpkg.com/react-router-redux/-/react-router-redux-5.0.0-alpha.9.tgz#825431516e0e6f1fd93b8807f6bd595e23ec3d10"
dependencies:
history "^4.7.2"
prop-types "^15.6.0"
react-router "^4.2.0"
react-router@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.2.0.tgz#61f7b3e3770daeb24062dae3eedef1b054155986"
dependencies:
history "^4.7.2"
hoist-non-react-statics "^2.3.0"
invariant "^2.2.2"
loose-envify "^1.3.1"
path-to-regexp "^1.7.0"
prop-types "^15.5.4"
warning "^3.0.0"
react-side-effect@^1.1.0:
version "1.1.5"
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-1.1.5.tgz#f26059e50ed9c626d91d661b9f3c8bb38cd0ff2d"
@ -9609,10 +9579,6 @@ resolve-from@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
resolve-pathname@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.2.0.tgz#7e9ae21ed815fd63ab189adeee64dc831eefa879"
resolve-url@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
@ -11172,10 +11138,6 @@ validator@^10.3.0:
version "10.3.0"
resolved "https://registry.yarnpkg.com/validator/-/validator-10.3.0.tgz#157a8c0981858cff381f59aabcdb8f83b57317cc"
value-equal@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7"
vary@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"