Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ICustomAttributeHandler<T>

The ICustomAttributeHandler interface represents an ability to handle custom properties that can be applied to intrinsic (HTML or SVG) elements.

Type parameters

  • T

Hierarchy

  • ICustomAttributeHandler

Index

Methods

Methods

Optional terminate

  • terminate(isRemoval: boolean): void
  • Terminates the functioning of the custom attribute handler. This method is invoked either when a new rendering of the element doesn't have the attribute anymore or if the element is removed. Although this method is optional, most handlers will need to implement it to properly cleanup any resources (e.g. event handlers) to avoid leaks.

    Parameters

    • isRemoval: boolean

      True if the element is being removed and false if the element is being updated and the attribute is no longer provided. If the handler adds any event listeners to the element, then it has to remove them on update but doen't have to do it on element removal.

    Returns void

update

  • update(newPropVal: T): boolean
  • Updates an existing custom attribute with the new value.

    Parameters

    • newPropVal: T

      New value of the custom attribute.

    Returns boolean

    True if changes were made and false otherwise.

Generated using TypeDoc