Replies: 4 comments 8 replies
-
|
Maybe |
Beta Was this translation helpful? Give feedback.
-
|
That's out of the scope of |
Beta Was this translation helpful? Give feedback.
-
This is a simplify version of my project, I need to implement |
Beta Was this translation helpful? Give feedback.
-
I found out this is just what I need, For a custom Can we just add a option for this? Otherwise I will need to maintain a fork or patch for just this one line. export const isChanged = (
prevObj: unknown,
nextObj: unknown,
affected: WeakMap<object, unknown>,
cache?: WeakMap<object, unknown>, // for object with cycles
isEqual: (a: unknown, b: unknown) => boolean = Object.is,
changedIfNotUsed = true // new option here
): boolean => {
if (isEqual(prevObj, nextObj)) {
return false;
}
if (!isObject(prevObj) || !isObject(nextObj)) return true;
const used = (affected as Affected).get(getOriginalObject(prevObj));
if (!used) return changedIfNotUsed ; // new option here
...
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I read this doc saying without properties access,
snap.sis assumed entire accessed.but I only need to re-render when
delete state.s,and I want no re-render when
state.s.a = 3.Beta Was this translation helpful? Give feedback.
All reactions