Skip to content

Commit

Permalink
Remove remaining deepSignal references
Browse files Browse the repository at this point in the history
  • Loading branch information
DAreRodz committed Jul 24, 2024
1 parent 1c9eabf commit 947b8d8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/interactivity/src/directives.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,20 @@ const proxifyContext = ( current: object, inherited: object = {} ): object => {
};

/**
* Recursively update values within a deepSignal object.
* Recursively update values within a context object.
*
* @param proxy A deepSignal instance.
* @param source Object with properties to update in `proxy`.
* @param target A context instance.
* @param source Object with properties to update in `target`.
*/
const updateSignals = ( proxy: any, source: any ) => {
const updateContext = ( target: any, source: any ) => {
for ( const k in source ) {
if (
isPlainObject( peek( proxy, k ) ) &&
isPlainObject( peek( target, k ) ) &&
isPlainObject( source[ k ] )
) {
updateSignals( peek( proxy, k ) as object, source[ k ] );
updateContext( peek( target, k ) as object, source[ k ] );
} else {
proxy[ k ] = source[ k ];
target[ k ] = source[ k ];
}
}
};
Expand Down Expand Up @@ -287,7 +287,7 @@ export default () => {
`The value of data-wp-context in "${ namespace }" store must be a valid stringified JSON object.`
);
}
updateSignals(
updateContext(
currentValue.current[ namespace ],
deepClone( value ) as object
);
Expand Down

0 comments on commit 947b8d8

Please sign in to comment.