Design Principles
Last updated
Last updated
A promise object is a "machine" holding one of two states:
Pending
Settled
A settled state is the deffered result of the promise. This state will be either (a) rejected or (b) resolved. The rejected state throws an error and the fulfilled state returns either null or a value.
See more: .
An action object describes changes to the store. Actions are the only source of information for the store.
See more: .
Promise middleware dispatches "asynchronous" action objects describing the state of the promise:
Pending action
Fullfilled or rejcted action (settled)
This affords asynchronous updates to the store.
Another way of thinking of this is promise middleware abstracts the two states of an promise object to two action objects.
Promise middleware dispatches actions in compliance with reccommendations.