Context
I'm building a Flow that needs to detect whether a Struct variable has been
edited by the user (e.g. a config sub-struct), by
comparing a saved snapshot against the current live value, and re-evaluating
whenever any member of the struct changes.
Questions
-
Struct equality with Compare (= operator)
Does the Compare action's = operator perform a deep, member-by-member
comparison when both operands are of type Struct, or does it compare by
reference ? The docs (P8. Variables) don't specify this.
-
Assignment semantics for Structs (SetVariable)
When doing SetVariable myVar <- otherStructVar, is the resulting value a
deep copy, or a reference to the same underlying struct instance?
-
Watching changes on a whole Struct
The Watch component docs describe monitoring "the value of the
variable" — is it possible to Watch an entire Struct variable and get
notified if any member changes, or is Watch limited to scalar/leaf
values, requiring one Watch per member?
Why this matters
This is a common pattern (dirty-state / "unsaved changes" detection on a
config form bound to a struct) and the docs don't currently clarify whether
struct comparison, copy, and watch semantics support it out of the box, or
whether member-by-member workarounds are required.
Thanks,
Context
I'm building a Flow that needs to detect whether a Struct variable has been
edited by the user (e.g. a config sub-struct), by
comparing a saved snapshot against the current live value, and re-evaluating
whenever any member of the struct changes.
Questions
Struct equality with
Compare(=operator)Does the
Compareaction's=operator perform a deep, member-by-membercomparison when both operands are of type Struct, or does it compare by
reference ? The docs (P8. Variables) don't specify this.
Assignment semantics for Structs (
SetVariable)When doing
SetVariable myVar <- otherStructVar, is the resulting value adeep copy, or a reference to the same underlying struct instance?
Watching changes on a whole Struct
The
Watchcomponent docs describe monitoring "the value of thevariable" — is it possible to
Watchan entire Struct variable and getnotified if any member changes, or is
Watchlimited to scalar/leafvalues, requiring one
Watchper member?Why this matters
This is a common pattern (dirty-state / "unsaved changes" detection on a
config form bound to a struct) and the docs don't currently clarify whether
struct comparison, copy, and watch semantics support it out of the box, or
whether member-by-member workarounds are required.
Thanks,