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

11 lines
312 B
JavaScript
Raw Normal View History

2016-03-02 22:19:04 -08:00
import { hardGoTo } from '../../common/app/redux/types';
export default function hardGoToSaga(action$, getState, { history }) {
2016-04-24 21:54:48 -07:00
return action$
.filter(({ type }) => type === hardGoTo)
.map(({ payload = '/settings' }) => {
history.push(history.state, null, payload);
2016-04-24 21:54:48 -07:00
return null;
});
}