dva-toolkit
Version:
A great dva typescript support toolkit inspired by @redux/toolkit
45 lines (44 loc) • 1.01 kB
TypeScript
import type { EffectType } from 'dva';
import type { call, put, take, select, cancel } from 'redux-saga/effects';
import type { PayloadAction } from '@reduxjs/toolkit';
/**
* saga effects supported by dva
*
* @public
*/
export declare type SagaEffectsCommandMap = {
put: typeof put;
call: typeof call;
select: typeof select;
take: typeof take;
cancel: typeof cancel;
[key: string]: any;
};
/**
* pure effect method
*
* @public
*/
export declare type DvaCaseEffects = (action: PayloadAction<any>, effects: SagaEffectsCommandMap) => Generator;
/**
* effect with saga config
*
* @public
*/
export declare type DvaCaseEffectWithType = [DvaCaseEffects, {
type: EffectType;
}];
/**
* all effect case
*
* @public
*/
export declare type DvaCaseEffectValue = DvaCaseEffects | DvaCaseEffectWithType;
/**
* effects in dva config
*
* @public
*/
export declare type DvaSliceCaseEffects = {
[K: string]: DvaCaseEffectValue;
};