Package: effect
Module: Predicate
Checks whether a value is a Promise-like object with then and catch.
When to use
Use when you need a Predicate guard for promise instances across realms.
Details
Performs a structural check for then and catch functions.
Example (Guarding promises)
import { Predicate } from "effect"
const data: unknown = Promise.resolve(1)
console.log(Predicate.isPromise(data))
See
isPromiseLikeSignature
declare const isPromise: (input: unknown) => input is Promise<unknown>
Since v2.0.0