AWRAL
Awesome Wrapper for Redux Action's Lifecycle
Swiss Army knife for async actions in Redux.
Why?
Assume you're using redux and redux-thunk.
README IN PROGRESS.
PLEASE, CHECK SOURCES!
When you work with async stuff you probably have next code in your container:
const mapDispatchToProps = { }
Where GET_USERS
is a next async action:
const GET_USER = async { const payload = await if else }
With AWRAL you can just write:
const GET_USER = 'GET_USER'
How?
There is only one method: Awral.of()
. of()
allows you to extend/rewrite your "awrals":
const checkResponseFromAPI = resultokconst transformResultAfter = resultdata// const success = ({dispatch, payload}) => {} const awralCheck = Awralconst awralCheckTransformBefore = awralCheckconst awral = Awral