Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "hs/proxy/index"

Index

Functions

Functions

proxy

  • proxy<I, O>(hs: HyperScope, hv: HyperValue<I>, getter: function, setter?: undefined | function): HyperValue<O>
  • Proxies access to a hyper-value by creating a new one. e.g. to make a hyper-value that proxy string hyper-value to number one you can write proxy(hs, hv, str => Number(str), num => String(num))

    Type parameters

    • I

      inner value type

    • O

      outer value type

    Parameters

    • hs: HyperScope

      HyperScope instance

    • hv: HyperValue<I>

      hyper-value to be proxied

    • getter: function

      transform inner value into outer value

        • (innerValue: I): O
        • Parameters

          • innerValue: I

          Returns O

    • Optional setter: undefined | function

      transform outer value into inner value

    Returns HyperValue<O>

Generated using TypeDoc