Luis Custodio bio photo

Luis Custodio

XP | Software Craftsperson

Email Twitter LinkedIn Github Stackoverflow

Async Action Creators

Middleware lets you inject custom logic that interprets every action object before it is dispatched. Async actions are the most common use case for middleware.

You could create a generic handler for all the api calls for instance. That triggers the REQUEST, SUCCESS and ERROR events. However it depends on the model and the complexity linked to the API result.

Punchline: If you want to clean up data before sending to the store you may end up having specific implementation for each API call.