FuncType - v0.45.0
    Preparing search index...

    Type Alias ContextType

    Context companion object with utility methods

    type ContextType = {
        empty: <R extends unknown = never>() => ContextType<R>;
        isContext: <R extends unknown>(value: unknown) => value is ContextType<R>;
        make: <S extends unknown>(tag: TagType<S>, service: S) => ContextType<S>;
    }
    Index

    Properties

    Properties

    empty: <R extends unknown = never>() => ContextType<R> = ...

    Creates an empty context with no services.

    isContext: <R extends unknown>(value: unknown) => value is ContextType<R> = ...

    Checks if a value is a Context.

    make: <S extends unknown>(tag: TagType<S>, service: S) => ContextType<S> = ...

    Creates a context with a single service.

    Type Declaration

      • <S extends unknown>(tag: TagType<S>, service: S): ContextType<S>
      • Type Parameters

        • S extends unknown

        Parameters

        • tag: TagType<S>

          The tag for the service

        • service: S

          The service implementation

        Returns ContextType<S>