freeCodeCamp/client/sagas/hard-go-to-saga.js

12 lines
338 B
JavaScript
Raw Normal View History

import types from '../../common/app/redux/types';
2016-03-03 06:19:04 +00:00
const { hardGoTo } = types;
export default function hardGoToSaga(action$, getState, { history }) {
2016-04-25 04:54:48 +00:00
return action$
.filter(({ type }) => type === hardGoTo)
.map(({ payload = '/settings' }) => {
history.pushState(history.state, null, payload);
2016-04-25 04:54:48 +00:00
return null;
});
}