crudSaga
crudSaga(options, extend) โ function
functionSimple Example:
const { createModule } from 'saga-slice';
const { crudInitialState, crudReducers } from 'saga-slice-helpers';
const { sagaApi } from './myApiFile';
const name = 'todos'; // should be rest api endpoint name
const initialState = crudInitialState();
const reducers = crudReducers();
const sagas = crudSaga({ name, sagaApi });
const { actions } = createModule({ name, initialState, reducers, sagas });Extended Example:
REST implementation
Last updated
Was this helpful?