redux-thunk support
Closed this issue · 1 comments
MillerGregor commented
It works, which is great, so it might be worth adding to the README:
A Duck's action creators can be normal plain objects or thunks (see: redux-thunk)
creators: (duck) => ({
logout: () => ({ type: duck.types.LOGOUT }),
removeTokenAsync: () => {
return dispatch => {
return StorageAsync.removeItem(tokenKey)
.then(() => (dispatch({ type: duck.types.REMOVE_TOKEN })));
}
}
})
akelmanson commented
Done! Sorry for the delay.
https://github.com/investtools/extensible-duck#defining-the-creators