Nude Element API Docs - v0.1.3
    Preparing search index...

    Class Signal

    Reactive value container. Reading .value inside a Computed's function automatically registers this signal as a dependency.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods

    Constructors

    • Parameters

      • value: any

        Initial value.

      • Optionaloptions: { equals?: (a: any, b: any) => boolean } = {}
        • Optionalequals?: (a: any, b: any) => boolean

          Custom equality check. Set as an instance override of the default === method.

      Returns Signal

    Accessors

    Methods

    • Overridable equality check. Defaults to ===.

      Parameters

      • a: any
      • b: any

      Returns boolean

    • Subscribe to value changes. Returns an unsubscribe function.

      Parameters

      • fn: Function

        Called with (newValue, oldValue) on change

      Returns Function

      Unsubscribe function