interface / @typed/fx/Sink

Sink.Class

Constructor-shaped Context service returned by Sink.Service.

Package version
2.0.0-beta.13
Category
Sink services
Since
1.0.0
Member of
Sink

Import

import { Sink } from "@typed/fx/Sink";

Access Sink.Class through the imported Sink export. Its declaration below describes the member.

Signatures

interface Class<Self, Id extends string, A, E> extends Service<Self, Id, A, E> {
    new (): Service<Self, Id, A, E>;
}

Why

A class-shaped tag supports standard Effect service declaration syntax while exposing the Sink callbacks directly as static operations.

Ownership and lifetime

Constructing the class returns its service tag; the providing Layer owns the concrete sink.

Construct signatures

Returns the service tag rather than allocating a separate sink instance.

Construct signatures: Why

This supports Effect’s class declaration syntax while keeping one service identity.

Construct signatures: Ownership and lifetime

Construction allocates no consumer resources; the provided Layer owns the concrete sink.

Examples

import * as Sink from "@typed/fx/Sink"
class Numbers extends Sink.Service<Numbers, number>()("Numbers") {}

Other public imports

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

Source