Class SharedInput

An input that can be shared between diagrams and get/set from outside the diagram. You should call useSharedInput to create a shared input, rather than calling new SharedInput directly.

Constructors

Properties

init?: number
name: string

Methods

  • Add an effect to run when the value of the input changes.

    Parameters

    • fn: ((val: number) => void)

      Effect to run

        • (val): void
        • Parameters

          • val: number

          Returns void

    Returns void

  • Remove an effect added with addEffect from the input.

    Parameters

    • fn: ((val: number) => void)

      Effect to remove

        • (val): void
        • Parameters

          • val: number

          Returns void

    Returns void

  • Set the value of the input. This will update the value in all diagrams, and trigger a re-render for the component that created the input.

    Parameters

    • val: number

      Value to set the input to

    Returns void