typescript(option): refactor: .then(Some) looks better than async await
Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
parent
c56f734d82
commit
729b901bc5
|
@ -7,11 +7,7 @@ export const mapAsync = <T, U>(
|
|||
option: Option<T>
|
||||
) => {
|
||||
return match(
|
||||
async value => {
|
||||
const output = await mapper(value)
|
||||
|
||||
return Some(output)
|
||||
},
|
||||
value => mapper(value).then(Some),
|
||||
Promise.resolve(None),
|
||||
option
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue