rum

Simple, decomplected, isomorphic HTML UI library for Clojure and ClojureScript | 0.12.8 https://github.com/tonsky/rum/blob/gh-pages/CHANGELOG.md#0128
amarjeet 2018-02-27T19:20:36.000668Z

@tonsky please see the above snippet, if you get time. Thanks

2018-02-27T19:53:22.000688Z

@amarjeet looks like you are fetching data, storing it in the state, component re-renders and fetching runs again and so on

amarjeet 2018-02-27T19:55:14.000286Z

@roman01la so, when the fetching re-runs, the local-state atom's value doesn't change. And, if the value doesn't change, the the App component's rendering should stop - thats my understanding of rum/reactive mixin

amarjeet 2018-02-27T19:55:46.000466Z

the local-state atom's value doesn't change because the fetch process fetches the same data

2018-02-27T19:57:49.000275Z

@amarjeet AFAIK, reactive mixin doesn’t check if the state has changed

amarjeet 2018-02-27T19:59:39.000183Z

no, it has subscribed to the local-state atom. So, for the 1st fetch, the value of local-state atom changes, and triggers the App render. But for the 2nd time, its value doesn't change, but assoc process does happen

amarjeet 2018-02-27T20:01:06.000238Z

So, it seems that as long as local-state gets the assoc operation (even though the final value doesn't change), the App component will render

2018-02-27T20:02:08.000400Z

every time you swap! the atom, it triggers watcher function here https://github.com/tonsky/rum/blob/gh-pages/src/rum/core.cljs#L325 which re-renders the component

amarjeet 2018-02-27T20:02:47.000264Z

ohho

amarjeet 2018-02-27T20:02:58.000475Z

understood

amarjeet 2018-02-27T20:03:10.000793Z

thats why its becoming a loop

amarjeet 2018-02-27T20:03:23.000419Z

thanks much @roman01la for this

👍 1