diff --git a/lib/$State.ts b/lib/$State.ts index 49cda3e..92d9458 100644 --- a/lib/$State.ts +++ b/lib/$State.ts @@ -2,18 +2,18 @@ export interface $StateOption { format: (value: T) => string; } export class $State { - readonly value: T; + readonly value!: T; readonly attributes = new Map>(); options: Partial<$StateOption> = {} constructor(value: T, options?: $StateOption) { - this.value = value; + this.set(value); if (options) this.options = options; } set(value: T) { (this as Mutable<$State>).value = value; + // update element content for eatch attributes for (const [node, attrList] of this.attributes.entries()) { for (const attr of attrList) { - console.debug(node, attr) //@ts-expect-error if (node[attr] instanceof Function) { //@ts-expect-error diff --git a/package.json b/package.json index 1f11418..fa25bde 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "elexis", "description": "Build Web in Native JavaScript Syntax", - "version": "0.2.2", + "version": "0.2.3", "author": { "name": "defaultkavy", "email": "defaultkavy@gmail.com",