AsyncMaybe<T> is an alias for
Promise<Maybe<T>>. The companion AsyncMaybe:namespace namespace
provides utilities for working with the AsyncMaybe<T> type.
To accommodate promise-like values, this module also provides the
AsyncMaybeLike<T> type as an alias for
PromiseLike<Maybe<T>>.
Optional values.
Remarks
Maybe<T>is a type that represents an optional value. It is represented by two variants:NothingandJust<T>.Nothingis the absentMaybeand contains no value.Just<T>is a presentMaybeand contains a value of typeT.The companion
Maybe:namespacenamespace provides utilities for working with theMaybe<T>type.Common uses for
Maybeinclude:Nothingis returned on failureUsing
Maybewith promisesAsyncMaybe<T>is an alias forPromise<Maybe<T>>. The companionAsyncMaybe:namespacenamespace provides utilities for working with theAsyncMaybe<T>type.To accommodate promise-like values, this module also provides the
AsyncMaybeLike<T>type as an alias forPromiseLike<Maybe<T>>.Importing from this module
The types and namespaces from this module can be imported under the same aliases:
Or, they can be imported and aliased separately: