ConanJs gives you a few mechanisms to announce within your actions that you are performing asynchronous operations.
These are the benefits:
NO boiler plate code to update your state asynchronously.
Automatically updates the Monitor Thread to reflect all the async operations running and their details. Allowing you to subscribe to these updates, to easily add loading screens, block buttons etc.
Allows accessing the underlying ASAPs running at the moment. Note this combined with the ASAPs being cancellable, makes complex scenarios like optimistic updates much simpler
There are two mechanisms to declare async actions: auto-bind and monitor actions.
return thread.monitor(//An AsapdiContext.issuesService.fetch(repo, org, page).catch(() => thread.reducers.$fetch()),//What to do when the asap resolves(issues, reducers) => reducers.$fetch(issues as Issue),//Next two params are for logging purposes// - Description of the async operation'fetch',// - Payload (also shown on the logging)[repo, org, page])