Closed
Description
I'm using Redux alongside with TypeScript and I created my custom class Action
and ActionCreator
//Action.ts
export default class Action
{
public type:string;
public data:any;
constructor(type:string, data:any = null)
{
this.type = type;
this.data = data;
}
}
// PhotoActions.ts
export function processPhoto(photoData:PhotoData)
{
return new Action(PROCESS_PHOTO, photoData);
}
When I try to dispatch this action I get error Actions must be plain objects. Use custom middleware for async actions.
Is it really necessary for action objects to be plain objects?