redux-promise-middleware-actions
redux-promise-middleware-actions copied to clipboard
Typescript dispatch return type
Hi, Is there an example on how to use the library with Typescript, How do I transform the return of the createAsyncAction after dispatching it, for example, I have an createGroup action and after dispatching it, the return type is this:
var createGroup: (data: GroupForm) => {
type: "CREATE_GROUP";
payload: Promise<NormalizedGroup>;
meta: number;
}
where I'm expecting this:
var createGroup: (data: GroupForm) => Promise<{
value: NormalizedGroup;
action: Action<SomeAction>;
}>