Skip to content

True Myth / maybe / just

Variable: just ​

const just: {<F>(value): Maybe<F>; <T, F>(value): never; <F>(value): never; <T>(value): Maybe<T>; } = MaybeImpl.just

Create a Maybe instance which is a Just.

null and undefined are allowed by the type signature so that the function may throw on those rather than constructing a type like Maybe<undefined>.

Call Signature ​

<F>(value): Maybe<F>

Create an instance of Maybe.Just.

Type Parameters ​

F ​

F extends (...args) => object

Parameters ​

value ​

F

The value to wrap in a Maybe.Just.

Returns ​

Maybe<F>

An instance of Maybe.Just<T>.

Throws ​

If you pass null or undefined.

Call Signature ​

<T, F>(value): never

Create an instance of Maybe.Just.

Type Parameters ​

T ​

T extends object

The type of the item contained in the Maybe.

F ​

F extends (...args) => T | null | undefined

Parameters ​

value ​

F

The value to wrap in a Maybe.Just.

Returns ​

never

An instance of Maybe.Just<T>.

Throws ​

If you pass null or undefined.

Call Signature ​

<F>(value): never

Create an instance of Maybe.Just.

Type Parameters ​

F ​

F extends (...args) => null | undefined

Parameters ​

value ​

F

The value to wrap in a Maybe.Just.

Returns ​

never

An instance of Maybe.Just<T>.

Throws ​

If you pass null or undefined.

Call Signature ​

<T>(value): Maybe<T>

Create an instance of Maybe.Just.

Type Parameters ​

T ​

T extends object

The type of the item contained in the Maybe.

Parameters ​

value ​

T

The value to wrap in a Maybe.Just.

Returns ​

Maybe<T>

An instance of Maybe.Just<T>.

Throws ​

If you pass null or undefined.

Template ​

The type of the item contained in the Maybe.

Param ​

The value to wrap in a Maybe.Just.

Returns ​

An instance of Maybe.Just<T>.

Throws ​

If you pass null or undefined.