Files
freeCodeCamp/client/sagas/hard-go-to-saga.js
2016-07-28 23:40:01 -07:00

11 lines
312 B
JavaScript

import { hardGoTo } from '../../common/app/redux/types';
export default function hardGoToSaga(action$, getState, { history }) {
return action$
.filter(({ type }) => type === hardGoTo)
.map(({ payload = '/settings' }) => {
history.push(history.state, null, payload);
return null;
});
}