Fork me on GitHub

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

Roman Liutikov19:02:22

@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

Roman Liutikov19:02:49

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


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

Roman Liutikov20:02:08

every time you swap! the atom, it triggers watcher function here which re-renders the component


thats why its becoming a loop


thanks much @roman01la for this