LearnNewsExamplesServices
Frontmatter
id246
titleautoGenerateGetSet() => set() => change check for non primitive params
stateClosed
labels
enhancement
assignees[]
createdAtFeb 25, 2020, 12:39 PM
updatedAtAug 27, 2024, 10:54 PM
githubUrlhttps://github.com/neomjs/neo/issues/246
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtAug 27, 2024, 10:54 PM

autoGenerateGetSet() => set() => change check for non primitive params

tobiu
tobiu commented on Feb 25, 2020, 12:39 PM

see #242

// todo: we could compare objects & arrays for equality
if (Neo.isObject(value) || Array.isArray(value) || value !== oldValue) {

The current approach will trigger a change event for each object / array, not checking if the content did change.

The reason was mostly that this logic is inside the Neo.mjs file itself.

The logic for working with non primitive types is e.g. here:

src/util/Array.mjs

src/util/Object.mjs

Obviously, we can not import those files into the very core file of the framework, but we can create shortcuts into the Neo namespace and assume that these util (core) files are always included. @ExtAnimal: Thoughts?

What we need is something like isDeeplyStrict() inside Siesta => a method which can check structures containing nested objects / arrays for equality.

This one should be mapped into the Neo namespace => Neo.isEqual()

tobiu added the enhancement label on Feb 25, 2020, 12:39 PM
tobiu
tobiu Aug 27, 2024, 10:54 PM

already resolved. Neo.core.Compare: isEqual()

tobiu closed this issue on Aug 27, 2024, 10:54 PM