function / @typed/ui/index

Carousel.makeState

Creates hydrated Carousel state. activeId is required and paused defaults to true.

Learn this UI primitive →

Package version
1.0.0-beta.7
Category
Slide and rotation state
Since
1.0.0
Member of
Carousel

Import

import { Carousel } from "@typed/ui/index";

Access Carousel.makeState through the imported Carousel 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 makeState(initial: InitialState): Effect.Effect<RefSubject.HydratedRefSubject<{
    readonly activeId: string;
    readonly paused: boolean;
}, Schema.SchemaError, never, never>, never, Scope.Scope>;

Examples

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

const program = Effect.scoped(
  Effect.gen(function* () {
    const state = yield* Carousel.makeState({ activeId: "slide-1" });
    const collection = yield* Carousel.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