You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometime we need to process RemoteFailure and return RemoteSuccess with some boolean flag, for example process RemoteFailure<AjaxError, boolean> 401 status and return const isAuthorized = success(false).
We should add a method called recover (may be discussed) accepting a callback transforming error to smth valueable. Similar to Filterable.filterMap such callback should return Some when transformation is applicable and None when not.
Type signature should be: recover: RemoteData<L, A> ~> (f: (l: L) => Option<A>) => RemoteData<L, A>
Possible implementation for RemoteFailure<L, A>:
Sometime we need to process
RemoteFailure
and return RemoteSuccess with some boolean flag, for example processRemoteFailure<AjaxError, boolean>
401 status and returnconst isAuthorized = success(false)
.We should add a method called
recover
(may be discussed) accepting a callback transforming error to smth valueable. Similar toFilterable.filterMap
such callback should returnSome
when transformation is applicable andNone
when not.Type signature should be:
recover: RemoteData<L, A> ~> (f: (l: L) => Option<A>) => RemoteData<L, A>
Possible implementation for
RemoteFailure<L, A>
:For
RemoteInitial
,RemotePending
,RemoteSuccess
should return self.The text was updated successfully, but these errors were encountered: