FuncType - v1.21.0
    Preparing search index...

    Interface Tag<S>

    A Tag identifies a service type and provides a unique identifier. Used for dependency injection with IO effects.

    // Define service interfaces
    interface UserService {
    getUser(id: string): IO<never, Error, User>
    }

    // Create a tag for the service
    const UserService = Tag<UserService>("UserService")

    // Use in effects
    const getUser = (id: string) =>
    IO.service(UserService).flatMap(svc => svc.getUser(id))
    interface Tag<S extends Type> {
        id: string;
        toString(): string;
    }

    Type Parameters

    • S extends Type

      The service type this tag identifies

    Index
    id: string

    Unique identifier for this tag

    • String representation

      Returns string