chore: linting
Some checks failed
Quality Check & Publish / quality (push) Failing after 27s
Quality Check & Publish / quality-failed-webhook (push) Has been skipped
Quality Check & Publish / publish (push) Has been skipped
Quality Check & Publish / publish-failed-webhook (push) Has been skipped

This commit is contained in:
Astrian Zheng 2025-05-21 21:36:32 +10:00
parent 27be016d29
commit c2b5300756
Signed by: Astrian
SSH Key Fingerprint: SHA256:rVnhx3DAKjujCwWE13aDl7uV6+9U1MvydLkNRXJrBiA
2 changed files with 7 additions and 8 deletions

View File

@ -54,7 +54,8 @@ export default (options: ComponentOptions) => {
stateToElementsMap: this._stateToElementsMap,
textBindings: this._textBindings,
attributeBindings: this._attributeBindings,
updateTextNode: (node: Text, value: string) => this._updateTextNode(node, value, value),
updateTextNode: (node: Text, value: string) =>
this._updateTextNode(node, value, value),
getNestedState: (keyPath: string) => this._getNestedState(keyPath),
scheduleUpdate: this._scheduleUpdate.bind(this),
statesListenersSelf: this._statesListeners,
@ -62,7 +63,7 @@ export default (options: ComponentOptions) => {
evaluateIfCondition: this._evaluateIfCondition.bind(this),
},
options.states,
options.statesListeners
options.statesListeners,
)
// initialize shadow dom

View File

@ -1,4 +1,4 @@
import triggerDomUpdates from "./triggerDomUpdates"
import triggerDomUpdates from './triggerDomUpdates'
export default function initState(
ops: {
@ -30,7 +30,7 @@ export default function initState(
statesListenersSelf: Record<string, (...args: unknown[]) => void>
},
states?: Record<string, unknown>,
statesListeners?: { [key: string]: (value: unknown) => void; } | undefined
statesListeners?: { [key: string]: (value: unknown) => void } | undefined,
) {
console.log(states)
// copy state from options
@ -82,9 +82,7 @@ export default function initState(
if (ops.currentRenderingElement) {
if (!ops.stateToElementsMap[keyPath])
ops.stateToElementsMap[keyPath] = new Set()
ops.stateToElementsMap[keyPath].add(
ops.currentRenderingElement,
)
ops.stateToElementsMap[keyPath].add(ops.currentRenderingElement)
}
const valueRoute = keyPath.split('.')
@ -101,4 +99,4 @@ export default function initState(
},
},
)
}
}