investtools/extensible-duck

redux-thunk support

Closed this issue · 1 comments

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 })));
                }
        }
    })