0.0.3: Exotic Type Gymnastics #3
| 
						 | 
					@ -54,7 +54,8 @@ export default (options: ComponentOptions) => {
 | 
				
			||||||
					stateToElementsMap: this._stateToElementsMap,
 | 
										stateToElementsMap: this._stateToElementsMap,
 | 
				
			||||||
					textBindings: this._textBindings,
 | 
										textBindings: this._textBindings,
 | 
				
			||||||
					attributeBindings: this._attributeBindings,
 | 
										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),
 | 
										getNestedState: (keyPath: string) => this._getNestedState(keyPath),
 | 
				
			||||||
					scheduleUpdate: this._scheduleUpdate.bind(this),
 | 
										scheduleUpdate: this._scheduleUpdate.bind(this),
 | 
				
			||||||
					statesListenersSelf: this._statesListeners,
 | 
										statesListenersSelf: this._statesListeners,
 | 
				
			||||||
| 
						 | 
					@ -62,7 +63,7 @@ export default (options: ComponentOptions) => {
 | 
				
			||||||
					evaluateIfCondition: this._evaluateIfCondition.bind(this),
 | 
										evaluateIfCondition: this._evaluateIfCondition.bind(this),
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				options.states,
 | 
									options.states,
 | 
				
			||||||
				options.statesListeners
 | 
									options.statesListeners,
 | 
				
			||||||
			)
 | 
								)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// initialize shadow dom
 | 
								// initialize shadow dom
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
import triggerDomUpdates from "./triggerDomUpdates"
 | 
					import triggerDomUpdates from './triggerDomUpdates'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default function initState(
 | 
					export default function initState(
 | 
				
			||||||
	ops: {
 | 
						ops: {
 | 
				
			||||||
| 
						 | 
					@ -30,7 +30,7 @@ export default function initState(
 | 
				
			||||||
		statesListenersSelf: Record<string, (...args: unknown[]) => void>
 | 
							statesListenersSelf: Record<string, (...args: unknown[]) => void>
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	states?: Record<string, unknown>,
 | 
						states?: Record<string, unknown>,
 | 
				
			||||||
	statesListeners?: { [key: string]: (value: unknown) => void; } | undefined
 | 
						statesListeners?: { [key: string]: (value: unknown) => void } | undefined,
 | 
				
			||||||
) {
 | 
					) {
 | 
				
			||||||
	console.log(states)
 | 
						console.log(states)
 | 
				
			||||||
	// copy state from options
 | 
						// copy state from options
 | 
				
			||||||
| 
						 | 
					@ -82,9 +82,7 @@ export default function initState(
 | 
				
			||||||
				if (ops.currentRenderingElement) {
 | 
									if (ops.currentRenderingElement) {
 | 
				
			||||||
					if (!ops.stateToElementsMap[keyPath])
 | 
										if (!ops.stateToElementsMap[keyPath])
 | 
				
			||||||
						ops.stateToElementsMap[keyPath] = new Set()
 | 
											ops.stateToElementsMap[keyPath] = new Set()
 | 
				
			||||||
					ops.stateToElementsMap[keyPath].add(
 | 
										ops.stateToElementsMap[keyPath].add(ops.currentRenderingElement)
 | 
				
			||||||
						ops.currentRenderingElement,
 | 
					 | 
				
			||||||
					)
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				const valueRoute = keyPath.split('.')
 | 
									const valueRoute = keyPath.split('.')
 | 
				
			||||||
| 
						 | 
					@ -101,4 +99,4 @@ export default function initState(
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user