A crude and dirty solution would be to set a watcher on the atom directly. On a side note: if this behavior remains consistent (:on-change only fires for user interaction) then that's useful for components which affect each other.
For instance, consider a Fahrenheit / Celsius calculator with fields for each temperature. When you type a number in either field the other changes. If you implement this using add-watch or a React mechanism to update @fahrenheit every time @celsius changes and @celsius every time @fahrenheit changes then you've set up a loop. (Floating point error defeats anything that checks for same-values before updating). :on-change (meaning on user-instigated change) doesn't suffer that issue. Typing in the Fahrenheit field fires an update to @celsius and hence the Celsius field; but there's no round trip. That being said, is there a way to simulate user interaction and deliberately fire on-change events? -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/clojurescript.
