Function: orElse()
Call Signature
orElse<
T
,E
,F
,U
>(elseFn
): (task
) =>Task
<T
|U
,F
>
Auto-curried, standalone function form of Task.prototype.orElse
.
TIP
The auto-curried version is provided for parity with the similar functions that the Maybe
and Result
modules provide. However, like Result
, you will likely find that this form is somewhat difficult to use, because TypeScript’s type inference does not support it well: you will tend to end up with an awful lot of unknown
unless you write the type parameters explicitly at the call site.
The non-curried form will not have that problem, so you should prefer it.
Type Parameters
T
T
The type of the value when the Task
resolves successfully.
E
E
The type of the rejection reason when the Task
rejects.
F
F
U
U
= T
Parameters
elseFn
(reason
) => Task
<U
, F
>
Returns
(
task
):Task
<T
|U
,F
>
Parameters
task
Task
<T
, E
>
Returns
Task
<T
| U
, F
>
Call Signature
orElse<
T
,E
,R
>(elseFn
): (task
) =>Task
<T
|ResolvesTo
<R
>,RejectsWith
<R
>>
Auto-curried, standalone function form of Task.prototype.orElse
.
TIP
The auto-curried version is provided for parity with the similar functions that the Maybe
and Result
modules provide. However, like Result
, you will likely find that this form is somewhat difficult to use, because TypeScript’s type inference does not support it well: you will tend to end up with an awful lot of unknown
unless you write the type parameters explicitly at the call site.
The non-curried form will not have that problem, so you should prefer it.
Type Parameters
T
T
The type of the value when the Task
resolves successfully.
E
E
The type of the rejection reason when the Task
rejects.
R
R
extends AnyTask
Parameters
elseFn
(reason
) => R
Returns
(
task
):Task
<T
|ResolvesTo
<R
>,RejectsWith
<R
>>
Parameters
task
Task
<T
, E
>
Returns
Task
<T
| ResolvesTo
<R
>, RejectsWith
<R
>>
Call Signature
orElse<
T
,E
,F
,U
>(elseFn
,task
):Task
<T
|U
,F
>
Auto-curried, standalone function form of Task.prototype.orElse
.
TIP
The auto-curried version is provided for parity with the similar functions that the Maybe
and Result
modules provide. However, like Result
, you will likely find that this form is somewhat difficult to use, because TypeScript’s type inference does not support it well: you will tend to end up with an awful lot of unknown
unless you write the type parameters explicitly at the call site.
The non-curried form will not have that problem, so you should prefer it.
Type Parameters
T
T
The type of the value when the Task
resolves successfully.
E
E
The type of the rejection reason when the Task
rejects.
F
F
U
U
= T
Parameters
elseFn
(reason
) => Task
<U
, F
>
task
Task
<T
, E
>
Returns
Task
<T
| U
, F
>
Call Signature
orElse<
T
,E
,R
>(elseFn
,task
):Task
<T
|ResolvesTo
<R
>,RejectsWith
<R
>>
Auto-curried, standalone function form of Task.prototype.orElse
.
TIP
The auto-curried version is provided for parity with the similar functions that the Maybe
and Result
modules provide. However, like Result
, you will likely find that this form is somewhat difficult to use, because TypeScript’s type inference does not support it well: you will tend to end up with an awful lot of unknown
unless you write the type parameters explicitly at the call site.
The non-curried form will not have that problem, so you should prefer it.
Type Parameters
T
T
The type of the value when the Task
resolves successfully.
E
E
The type of the rejection reason when the Task
rejects.
R
R
extends AnyTask
Parameters
elseFn
(reason
) => R
task
Task
<T
, E
>
Returns
Task
<T
| ResolvesTo
<R
>, RejectsWith
<R
>>