diff --git a/state.js b/state.js index 979fc6c..891e4d0 100644 --- a/state.js +++ b/state.js @@ -6,7 +6,7 @@ export class ChangeEvent extends Event { } get final() { if (!this.#final) { - this.#final = new Map(changes) + this.#final = new Map(this.changes) } return this.#final } @@ -115,8 +115,8 @@ export class StoredState extends State { // Initialise storage from defaults for (let [prop, value] of Object.entries(init)) { - if (prop === this.#valueKey) prop = 'value' - if (this.#storage[prop] == undefined) + if (prop === 'value') prop = this.#valueKey + if (this.#storage[prop] === undefined) this.set(prop, value) }