v0.2.3
fix: remove $State debug message
This commit is contained in:
parent
7f8f599b8a
commit
72f617df3c
@ -2,18 +2,18 @@ export interface $StateOption<T> {
|
|||||||
format: (value: T) => string;
|
format: (value: T) => string;
|
||||||
}
|
}
|
||||||
export class $State<T> {
|
export class $State<T> {
|
||||||
readonly value: T;
|
readonly value!: T;
|
||||||
readonly attributes = new Map<Object, Set<string | number | symbol>>();
|
readonly attributes = new Map<Object, Set<string | number | symbol>>();
|
||||||
options: Partial<$StateOption<T>> = {}
|
options: Partial<$StateOption<T>> = {}
|
||||||
constructor(value: T, options?: $StateOption<T>) {
|
constructor(value: T, options?: $StateOption<T>) {
|
||||||
this.value = value;
|
this.set(value);
|
||||||
if (options) this.options = options;
|
if (options) this.options = options;
|
||||||
}
|
}
|
||||||
set(value: T) {
|
set(value: T) {
|
||||||
(this as Mutable<$State<T>>).value = value;
|
(this as Mutable<$State<T>>).value = value;
|
||||||
|
// update element content for eatch attributes
|
||||||
for (const [node, attrList] of this.attributes.entries()) {
|
for (const [node, attrList] of this.attributes.entries()) {
|
||||||
for (const attr of attrList) {
|
for (const attr of attrList) {
|
||||||
console.debug(node, attr)
|
|
||||||
//@ts-expect-error
|
//@ts-expect-error
|
||||||
if (node[attr] instanceof Function) {
|
if (node[attr] instanceof Function) {
|
||||||
//@ts-expect-error
|
//@ts-expect-error
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "elexis",
|
"name": "elexis",
|
||||||
"description": "Build Web in Native JavaScript Syntax",
|
"description": "Build Web in Native JavaScript Syntax",
|
||||||
"version": "0.2.2",
|
"version": "0.2.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "defaultkavy",
|
"name": "defaultkavy",
|
||||||
"email": "defaultkavy@gmail.com",
|
"email": "defaultkavy@gmail.com",
|
||||||
|
Loading…
Reference in New Issue
Block a user