function / @typed/fx

Fx.isFx

Checks whether a value carries the FxTypeId protocol property.

Package version
2.0.0-beta.13
Category
Runtime inspection
Since
1.0.0
Member of
Fx

Import

import { Fx } from "@typed/fx";

Access Fx.isFx through the imported Fx export. Its declaration below describes the member.

This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.

Signatures

export declare function isFx(u: unknown): u is Fx<any, any, any>;

Why

Interoperability code can distinguish an already constructed Fx from effects, streams, iterables, and arbitrary values before choosing an explicit adapter.

Ownership and lifetime

The guard performs one property check. It does not subscribe to or run the value.

Examples

import { isFx, succeed } from "@typed/fx/Fx"

const candidate: unknown = succeed(42)
const value = isFx(candidate) ? candidate : succeed(candidate)

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source