variable / @typed/async-data

isNoData

Tests whether an AsyncData value is NoData.

Package version
1.0.0-beta.13
Category
State inspection
Since
1.0.0

Import

import { isNoData } from "@typed/async-data";

Signatures

export declare const isNoData: <A, E>(asyncData: AsyncData<A, E>) => asyncData is NoData;

Why

A named refinement narrows the union without duplicating tag checks.

Ownership and lifetime

This pure predicate acquires no resources and does not retain its argument.

Examples

import { isNoData, NoData } from "@typed/async-data"
isNoData(NoData)

Source