From c2b5300756b5008b0b64254b7bd6121d8fabadd5 Mon Sep 17 00:00:00 2001 From: Astrian Zheng Date: Wed, 21 May 2025 21:36:32 +1000 Subject: [PATCH] chore: linting --- src/main.ts | 5 +++-- src/utils/initState.ts | 10 ++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main.ts b/src/main.ts index fdece94..609eb25 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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 diff --git a/src/utils/initState.ts b/src/utils/initState.ts index 14a44f7..59e9f65 100644 --- a/src/utils/initState.ts +++ b/src/utils/initState.ts @@ -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 void> }, states?: Record, - 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( }, }, ) -} \ No newline at end of file +}