effect-io-ai

Package: effect
Module: Predicate

Predicate.isPromiseLike

Checks whether a value is PromiseLike (has a then method).

When to use

Use when you need a Predicate guard for promise-like values with a callable then method.

Details

Performs a structural check for a callable then.

Example (Guarding promise-like values)

import { Predicate } from "effect"

const data: unknown = { then: () => {} }

console.log(Predicate.isPromiseLike(data))

See

Signature

declare const isPromiseLike: (input: unknown) => input is PromiseLike<unknown>

Source

Since v2.0.0