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 is pretty much a complete rewrite of
barracks
, catered for choo; it now has a better split out architecture that caters to all forms of async problems. In essence it's quite similar tochoo@2
; but adds composition foreffects
(as per choojs/choo#34).There's also a notion of
handlers
that can react to state changes, errors and actions (as per choojs/choo#15). This API is slightly awkward I've found that each handler is slightly different; but I reckon they're good enough. The only point of debate would be whether or not to make thecaller
argument an array to display the full stack trace; and to add thecaller
to theonError
handler. The latter adding a reasonable source of complexity for information that's available already despite in a shittier format. Input here would be heaps valued.Also we're not 100% test covered (sitting closer to 70%); but I've run this off every example in
choo
and it seems to work soooo ✨I'd suggest reading the README.md file for a full overview of the new API. Thanks!