This adds an alt function and an Alt typeclass instance to Relude.AsyncResult. The rules are as follows (with some tests provided that hopefully ensure this):
When both AsyncResults are in the same error state (both Complete or both Reloading), the first is returned
Complete(Error(_)) is preferred over Reloading(Error(_))
All non-error states are preferred over an error
When neither is an error, the rules from AsyncData's alt apply (Complete > Reloading > Loading > Init)
This adds an
alt
function and anAlt
typeclass instance toRelude.AsyncResult
. The rules are as follows (with some tests provided that hopefully ensure this):Complete(Error(_))
is preferred overReloading(Error(_))
alt
apply (Complete > Reloading > Loading > Init)