Map names of forward states to "value"
This commit is contained in:
parent
64b73676cb
commit
7febebce65
1 changed files with 4 additions and 2 deletions
6
state.js
6
state.js
|
@ -128,9 +128,11 @@ export class ForwardState extends EventTarget {
|
|||
backend.addEventListener("change", event => {
|
||||
const state = ref.deref()
|
||||
if (state) {
|
||||
const relevantChanges = event.changes.filter(([name]) => name === property)
|
||||
const relevantChanges = event.changes
|
||||
.filter(([name]) => name === property)
|
||||
.map(([_, value]) => ["value", value])
|
||||
if (relevantChanges.length > 0)
|
||||
state.dispatchEvent(new ChangeEvent(relevantChanges))
|
||||
state.dispatchEvent(new ChangeEvent(...relevantChanges))
|
||||
} else {
|
||||
abortController.abort()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue