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>
|
option: Option<T>
|
||||||
) => {
|
) => {
|
||||||
return match(
|
return match(
|
||||||
async value => {
|
value => mapper(value).then(Some),
|
||||||
const output = await mapper(value)
|
|
||||||
|
|
||||||
return Some(output)
|
|
||||||
},
|
|
||||||
Promise.resolve(None),
|
Promise.resolve(None),
|
||||||
option
|
option
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue