File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
packages/signals/signals/src/core/signal-generators/dom-gen Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,13 @@ const DEFAULT_OBSERVED_ROLES = [
3232 'treeitem' ,
3333]
3434
35- const partialMatch = < Obj extends Record < string , any > > (
36- a : Partial < Obj > ,
37- b : Obj
35+ // Check if a subset object is a partial match of another object
36+ const isObjectMatch = < Obj extends Record < string , any > > (
37+ partialObj : Partial < Obj > ,
38+ mainObj : Obj
3839) : boolean => {
39- return Object . keys ( a ) . every (
40- ( key ) => a [ key as keyof Obj ] === b [ key as keyof Obj ]
40+ return Object . keys ( partialObj ) . every (
41+ ( key ) => partialObj [ key as keyof Obj ] === mainObj [ key as keyof Obj ]
4142 )
4243}
4344type AttributeMutations = { [ attributeName : string ] : string | null }
@@ -263,7 +264,7 @@ export class MutationObservable {
263264 // if the value is the same as the last one emitted from a given element, we don't want to emit it again
264265 const prevMutations = this . prevMutationsCache . get ( element )
265266 if ( prevMutations ) {
266- const hasActuallyChanged = ! partialMatch ( mutations , prevMutations )
267+ const hasActuallyChanged = ! isObjectMatch ( mutations , prevMutations )
267268 if ( ! hasActuallyChanged ) {
268269 return
269270 }
You can’t perform that action at this time.
0 commit comments