Constructor
new Either(val)
Either monad
- Source:
Parameters:
Name | Type | Description |
---|---|---|
val |
*
|
Value to be validated |
Example
const m = Either.of(props.customers).map(contract => customer[0]).getOrElse('No customer found')
Members
type :String
Properties:
Name | Type | Description |
---|---|---|
type |
String
|
Returns the string 'Either' for all Either objects |
- Source:
Type:
-
String
Example
const m = Either.of([[1,2],[2,3],[4,5]])
m.type === 'Either'
Methods
(static) of(val) → {Either}
Creates a Either monad from the provided argument
- Source:
Parameters:
Name | Type | Description |
---|---|---|
val |
*
|
Val to turn in to a Either monad, can be a function |
Returns:
- Type:
-
Either
Example
const m = Either.of(props.customers).map(customer => customer[0]).getOrElse('No customer found')