Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the
Effect
type to deal with asynchronous computations performed by actions returned from primitive tasks.The
Effect
type is a mix between a promise, a function and anobservable. It provides a way to combine an async computation with a
sync version which "simulates" the effect that the async computation
will have on the underlying system. These types are also composable via
map
andflatMap
, which would allow building more complex effectsfrom simpler ones, however this is outside the scope of the current PR
(see PR #33 for a use of those ideas).
This PR changes the
Action
type to return effects instead of a Promisewhich makes all actions observable by default, while keeping the action result
awaitable. This change is compatible with the existing API
Change-type: minor