- withLifecycle(tag, handler): CTag
-
Parameters
-
-
handler: {
beforeRemove?: ((tag) => boolean | Promise<boolean>);
removed?: ((tag) => void);
start?: ((tag) => boolean | Promise<boolean>);
}
-
Optional
beforeRemove?: ((tag) => boolean | Promise<boolean>)
-
- (tag): boolean | Promise<boolean>
-
Returns boolean | Promise<boolean>
-
Optional
removed?: ((tag) => void)
-
Optional
start?: ((tag) => boolean | Promise<boolean>)
-
- (tag): boolean | Promise<boolean>
-
Returns boolean | Promise<boolean>
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.