connect, free yourself from extra code
Free your component from
redux-act-dispatch-free
extendsredux-act
so that you can call async actions without dispatch.
So it allows you to access a bound store from an asyncAction
Instalation
npm install redux-act-dispatch-free --save
Example
createAsyncCycle
new at 17 nov 2017
// userActions.js; // You can return any async (or not) function// and thay will automaticaly dispatch all async lifecicle functionsconst fetchGetUserData successGetUserData errorGetUserData = ;
fetchGetUserData
will generate:
Call "[fetch] get user data"
...after some time...
"[success] get user data" or "[error] get user data"
You can customize output payload
const fetchGetUserData successGetUserData errorGetUserData = ;
More custom way
// userActions.js;; const responseUserInfo = ;const errorResponceUserInfo = ; const fetchUserInfo = ;
// initStore.js;;;//... const store = ; ;//...
// Component.jsx;//... { };//...
Attention: bindAll and assignAll do not work with SSR