# makeState

Creates hydrated Composite state. activeId defaults to null, orientation to horizontal, loop to
true, RTL and virtual focus to false.

## Signatures

```ts
export declare function makeState(initial?: InitialState): Effect.Effect<RefSubject.HydratedRefSubject<{
    readonly activeId: string | null;
    readonly orientation: "horizontal" | "vertical" | "both";
    readonly loop: boolean;
    readonly rtl: boolean;
    readonly virtualFocus: boolean;
}, Schema.SchemaError, never, never>, never, import("effect/Scope").Scope>;
```

## Why

State and collection ownership can be composed and tested independently from any renderer.

## Ownership and lifetime

The returned Effect creates the RefSubject when run. That state is renderer-independent;
collection registrations belong to the separate Scope that runs register or ref, not to state
creation.

## Examples

```ts
import * as Effect from "effect/Effect";
import * as Collection from "@typed/ui/Collection";
import * as Composite from "@typed/ui/Composite";

const program = Effect.scoped(
  Effect.gen(function* () {
    const state = yield* Composite.makeState({});
    const collection = yield* Collection.makeState<string>();
    return { state: yield* state, collection: yield* collection };
  }),
);
```
