@tonsky please see the above snippet, if you get time. Thanks
@amarjeet looks like you are fetching data, storing it in the state, component re-renders and fetching runs again and so on
@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
the local-state atom's value doesn't change because the fetch process fetches the same data
@amarjeet AFAIK, reactive
mixin doesn’t check if the state has changed
https://github.com/tonsky/rum/blob/gh-pages/src/rum/core.cljs#L325
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
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
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
ohho
understood
thats why its becoming a loop
thanks much @roman01la for this