En mi aplicación React Native, he creado una clase desde donde estoy llamando a algunas funciones del servidor. Estoy usando Async/Await para esto. Pero esto me está mostrando el error de Error: Actions must be plain objects. Use custom middleware for async actions. . Aquí está mi clase que estoy usando:
class NotificationsService { public async setNotificationsMode(param: any): Promise<any> { var paramData = param.payload; await paramData.map((item: any)=>{ return serviceContainer.commandClient.send({ action: CommandActionType.SET, command: 'user_notifications', id: item.id, param: item.enabled }); }) } }Ahora, supongo que no estoy usando async/await correctamente aquí. O hay algo mal cuando intento mapear la matriz paramData y regresar. Gracias por adelantado.