function / @typed/ui/Grid

makeState

Creates hydrated Grid state. activeId defaults to null.

Learn this UI primitive →

Package version
1.0.0-beta.13
Category
Cell focus
Since
1.0.0

Import

import { makeState } from "@typed/ui/Grid";

Signatures

export declare function makeState(initial?: InitialState): Effect.Effect<RefSubject.HydratedRefSubject<{
    readonly activeId: string | null;
}, Schema.SchemaError, never, never>, never, Scope.Scope>;

Examples

import * as Effect from "effect/Effect";
import * as Grid from "@typed/ui/Grid";

const program = Effect.scoped(
  Effect.gen(function* () {
    const state = yield* Grid.makeState({});
    const collection = yield* Grid.makeCollection();
    return { state: yield* state, collection: yield* collection };
  }),
);

Other public imports

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

Source