1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

hero slider

This commit is contained in:
Fedor Katurov 2019-10-24 15:44:40 +07:00
parent a9da7e8cef
commit 5cd5941be0
12 changed files with 266 additions and 14 deletions

View file

@ -2,23 +2,29 @@ import { takeLatest, call, put, select } from 'redux-saga/effects';
import { REHYDRATE } from 'redux-persist';
import { FLOW_ACTIONS } from './constants';
import { getNodes } from '../node/api';
import { flowSetNodes, flowSetCellView } from './actions';
import { flowSetNodes, flowSetCellView, flowSetHeroes } from './actions';
import { IResultWithStatus, INode } from '../types';
import { selectFlowNodes } from './selectors';
import { reqWrapper } from '../auth/sagas';
import { postCellView } from './api';
import { IFlowState } from './reducer';
function* onGetFlow() {
const {
data: { nodes = null },
}: IResultWithStatus<{ nodes: INode[] }> = yield call(getNodes, {});
data: { nodes = null, heroes = null },
}: IResultWithStatus<{ nodes: IFlowState['nodes']; heroes: IFlowState['heroes'] }> = yield call(
getNodes,
{}
);
if (!nodes || !nodes.length) {
yield put(flowSetNodes([]));
yield put(flowSetHeroes([]));
return;
}
yield put(flowSetNodes(nodes));
yield put(flowSetHeroes(heroes));
}
function* onSetCellView({ id, flow }: ReturnType<typeof flowSetCellView>) {