mw.test => ts
This commit is contained in:
parent
e63f844bdc
commit
366bd91cf6
@ -7,7 +7,7 @@ test( 'simple effect', () => {
|
||||
|
||||
const store = updux({
|
||||
effects: {
|
||||
foo: api => next => action => {
|
||||
foo: (api:any) => (next:any) => (action:any) => {
|
||||
tracer();
|
||||
next(action);
|
||||
},
|
||||
@ -30,7 +30,7 @@ test( 'effect and sub-effect', () => {
|
||||
|
||||
const tracer = jest.fn();
|
||||
|
||||
const tracerEffect = signature => api => next => action => {
|
||||
const tracerEffect = ( signature: string ) => ( api:any ) => (next:any) => ( action: any ) => {
|
||||
tracer(signature);
|
||||
next(action);
|
||||
};
|
||||
@ -83,7 +83,7 @@ test( '"*" effect', () => {
|
||||
|
||||
test( 'async effect', async () => {
|
||||
|
||||
function timeout(ms) {
|
||||
function timeout(ms:number) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { Middleware } from 'redux';
|
||||
|
||||
export type Action = {
|
||||
type: string,
|
||||
@ -20,7 +21,7 @@ export type UpduxConfig<S=any> = Partial<{
|
||||
[ type: string ]: ActionPayloadGenerator
|
||||
},
|
||||
mutations: any,
|
||||
effects: any,
|
||||
effects: Dictionary<Middleware>,
|
||||
}>;
|
||||
|
||||
export type Upreducer<S=any> = (action:Action) => (state:S) => S;
|
||||
|
Loading…
Reference in New Issue
Block a user