Quantcast
Viewing latest article 2
Browse Latest Browse All 3

Answer by Kokovin Vladislav for getState in redux-saga?

you can use select effect

import {select, ...} from 'redux-saga/effects'

function* deserialize( action ) {
    const state = yield select();
    ....
    yield put({ type: 'DESERIALIZE_COMPLETE' });
}

also you can use it with selectors

const getItems = state => state.items;

function* deserialize( action ) {
    const items = yield select(getItems);
    ....
    yield put({ type: 'DESERIALIZE_COMPLETE' });
}

Viewing latest article 2
Browse Latest Browse All 3

Trending Articles