Ramonda

fresh-value-from-a-watch-selector

This fails the run. Where it is wrong about your code, // ramonda-check-ignore <reason> on the line says so, and the reason is printed on every run.

Reported when a @watchProp selector builds the value it returns — an object or an array — so Object.is can never match it and the watcher fires on every props change with nothing changed.

A selector's value is compared with Object.is, so a value BUILT inside the selector is never equal to the one before it. Measured: a watcher whose selector returns p.q fired zero times over three unrelated props changes, and one returning { q: p.q } fired three.

This is an error rather than a warning because a @watchProp body is where an app refetches, resets a form, cancels a request — firing it when nothing changed is wrong, not slow. And there is no version of it that was intended: a selector that always says CHANGED is a selector that does nothing.

Write one selector per value. They are handed over as a tuple, in the order you wrote them, and previous[i] === next[i] tells you which one moved:

@watchProp((p) => p.page, (p) => p.term)
reload(next: [number, string], previous: [number, string]) { … }

A selector that READS an object rather than building one — (p) => p.filter — is fine here. If that prop is rebuilt by the parent, fresh-object-in-props reports it at the call site, which is where the fix belongs.

Next