Module

Data.Ui

Package
purescript-webcomponents
Repository
Risto-Stevcev/purescript-webcomponents

#CustomElement Source

#onMount Source

onMount :: forall e sym. (HTMLElement -> Eff e Unit) -> CustomElement sym -> Eff e (CustomElement sym)

Attaches a connectedCallback to the given CustomElement and returns it for easier chaining. This function is side effecting because it mutates the given CustomElement

#onUnmount Source

onUnmount :: forall e sym. (HTMLElement -> Eff e Unit) -> CustomElement sym -> Eff e (CustomElement sym)

Attaches a disconnectedCallback to the given CustomElement and returns it for easier chaining. This function is side effecting because it mutates the given CustomElement

#onAdopt Source

onAdopt :: forall e sym. (HTMLElement -> Eff e Unit) -> CustomElement sym -> Eff e (CustomElement sym)

Attaches an adoptedCallback to the given CustomElement and returns it for easier chaining. This function is side effecting because it mutates the given CustomElement

#on Source

on :: forall e sym. String -> (HTMLElement -> String -> String -> Eff e Unit) -> CustomElement sym -> Eff e (CustomElement sym)

Adds the given attribute to observedAttributes if it is not included and calls the given callback when attributeChangedCallback fires for that attribute. This function is side effecting because it mutates the given CustomElement

#customElement Source

customElement :: forall e sym. Array String -> (HTMLElement -> Eff e Unit) -> (HTMLElement -> Eff e Unit) -> (HTMLElement -> Eff e Unit) -> (HTMLElement -> String -> String -> String -> Eff e Unit) -> (HTMLElement -> Eff e Unit) -> CustomElement sym

A rough translation of creating a web component by extending HTMLElement

#element Source

element :: forall sym e. (HTMLElement -> Eff e Unit) -> CustomElement sym

Creates an empty web component to be customized with the combinator functions

#registerElement Source

registerElement :: forall sym e. IsSymbol sym => SProxy sym -> CustomElement sym -> Eff (dom :: DOM | e) Unit

Registers an element in the web components registry. Any properties of the CustomElement that are changed, such as adding on, onMount, or onUnmount listeners, must execute before calling this function in order for them to work

Modules
Data.Ui