1.1.7 • Published 3 years ago

@zgo/redux-middleware-async v1.1.7

Weekly downloads
209
License
MIT
Repository
github
Last release
3 years ago

redux-middleware-async

This is a middleware of redux.it can help us to do async events and transfer their results to redux!

usage

import getRA from 'redux-middleware-async'
import * as reducers from './reducers'

const reducer = combineReducers(reducers) const store = createStore(reducer, applyMiddleware(getRA({ actionName?: string; succuss?: (results: any) => any; error?: (error: any) => void; start?: (dispacth: Dispatch, actionName: string) => void; always?: (dispacth: Dispatch, actionName: string) => void; })));

store.dispatch({ type: string; succuss?: (results: any, cb: () => any) => Object; error?: (error: any, cb: () => void) => void; start?: (dispacth: Dispatch, actionName: string, cb: () => void) => void; always?: (dispacth: Dispatch, actionName: string, cb: () => void) => void; actionName: () => Promise; // actionName对应初始化定义 })

## example
[index.tsx](./example/index.tsx)
[App.tsx](./example/App.tsx)
1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago