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 to choo@2; but adds composition for effects (as per https://github.com/yoshuawuyts/choo/issues/34).
There's also a notion of handlers that can react to state changes, errors and actions (as per https://github.com/yoshuawuyts/choo/issues/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 the caller argument an array to display the full stack trace; and to add the caller to the onError 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 :sparkles:
I'd suggest reading the README.md file for a full overview of the new API. Thanks!
Coverage decreased (-5.5%) to 94.488% when pulling a56213d4d0d4f30804a707b1bbfd93bf2f5dc233 on elm-it-up into 7160651a28f1107bdf4c3cc012c0bed57a1abc99 on master.
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 https://github.com/yoshuawuyts/choo/issues/34).There's also a notion of
handlers
that can react to state changes, errors and actions (as per https://github.com/yoshuawuyts/choo/issues/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 :sparkles:I'd suggest reading the README.md file for a full overview of the new API. Thanks!