Provides some utility functions.
Methods
# inner getApi(dom)
Retrieves a provided API from the given HTMLElement. The function is
"null-safe", i.e. if the argument is null
, it returns null
.
Parameters:
Name | Type | Description |
---|---|---|
dom |
the element from the DOM tree with the api property set by provideApi. |
# inner provideApi(dom, api)
Ensures (using onMount
and onBeforeUnmount
) that the given
api is made available as property of the given HTMLElement.
Parameters:
Name | Type | Description |
---|---|---|
dom |
the element from the DOM tree |
|
api |
the API to make available |