@metreeca/core - v0.12.0
    Preparing search index...

    Function createRelay

    • Creates a type-safe relay function for an option.

      Handler and fallback results are returned as-is, neither cloned nor frozen: their mutability is up to the code that produces them.

      Type Parameters

      • O extends Options

        The options type defining all possible option variants

      Parameters

      • option: Option<O>

        An option variant

      Returns Relay<O>

      An immutable Relay function that accepts handlers for each option and an optional fallback