variable / @typed/async-data

success

Creates a successful state with optional refresh progress.

Package version
1.0.0-beta.7
Category
State construction
Since
1.0.0

Import

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

Signatures

export declare const success: <A>(value: A, progress?: Progress) => Success<A>;

Why

The constructor preserves the payload type while making refresh state explicit.

Ownership and lifetime

This pure function acquires no resources; the returned wrapper retains the supplied value.

Examples

import { success } from "@typed/async-data"
const state = success("ready")

Source