Function withLifecycle

  • Will call {handler.onStart} when the element is added to the DOM. And will call {handler.onRemove} when the element is removed from the DOM.

    Parameters

    • tag: CTag
    • handler: {
          beforeRemove?: ((tag) => boolean | Promise<boolean>);
          removed?: ((tag) => void);
          start?: ((tag) => boolean | Promise<boolean>);
      }
      • Optional beforeRemove?: ((tag) => boolean | Promise<boolean>)
          • (tag): boolean | Promise<boolean>
          • Parameters

            Returns boolean | Promise<boolean>

      • Optional removed?: ((tag) => void)
          • (tag): void
          • Parameters

            Returns void

      • Optional start?: ((tag) => boolean | Promise<boolean>)
          • (tag): boolean | Promise<boolean>
          • Parameters

            Returns boolean | Promise<boolean>

    Returns CTag

Generated using TypeDoc