switchyard
    Preparing search index...

    Function bindField

    • Keeps a machine's state in a string property, as active state paths separated by spaces ('loading.retrying'). mirror (the default) restores from target[key] once, then writes every transition back: a record attribute. accessor makes target[key] a getter/setter over the machine: a query param. Writing restores the machine without running actions, and resets its history. Returns a function that unbinds.

      Parameters

      • machine: Machine<unknown>
      • target: object
      • key: string
      • __namedParameters: { mode?: "mirror" | "accessor" } = {}

      Returns () => void