refactor: clean up
This commit is contained in:
parent
3066efa6ff
commit
cb8cba3c22
2 changed files with 7 additions and 12 deletions
|
@ -22,6 +22,7 @@ export class WebComponent extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read-only property containing camelCase counterparts of observed attributes.
|
* Read-only property containing camelCase counterparts of observed attributes.
|
||||||
|
* @typedef {{[name: string]: any}} PropStringMap
|
||||||
* @see https://www.npmjs.com/package/web-component-base#prop-access
|
* @see https://www.npmjs.com/package/web-component-base#prop-access
|
||||||
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
|
||||||
* @type {PropStringMap}
|
* @type {PropStringMap}
|
||||||
|
@ -52,6 +53,11 @@ export class WebComponent extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggered when an attribute value changes
|
* Triggered when an attribute value changes
|
||||||
|
* @typedef {{
|
||||||
|
* property: string,
|
||||||
|
* previousValue: any,
|
||||||
|
* currentValue: any
|
||||||
|
* }} Changes
|
||||||
* @param {Changes} changes
|
* @param {Changes} changes
|
||||||
*/
|
*/
|
||||||
onChanges(changes) {}
|
onChanges(changes) {}
|
||||||
|
@ -173,12 +179,3 @@ export class WebComponent extends HTMLElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default WebComponent;
|
export default WebComponent;
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {{
|
|
||||||
* property: string,
|
|
||||||
* previousValue: any,
|
|
||||||
* currentValue: any
|
|
||||||
* }} Changes
|
|
||||||
* @typedef {{[name: string]: any}} PropStringMap
|
|
||||||
*/
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
/**
|
/**
|
||||||
*
|
* Attach a "side effect" function that gets triggered on property value changes
|
||||||
* @typedef { import('./WebComponent.js').Changes} Changes
|
|
||||||
* @typedef { import('./WebComponent.js').PropStringMap} PropStringMap
|
|
||||||
* @param {Object} obj
|
* @param {Object} obj
|
||||||
* @param {(newValue: any) => void} callback
|
* @param {(newValue: any) => void} callback
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue