Fork me on GitHub

Hey! What's the difference between reagent.ratom/run! and reagent.core/track!? I want to save my app-db r/atom to localStorage whenever my app-db changes. I saw for track! that sound like what I want but I don't like that I have to define two things (seems cumbersome) and it didn't seem to work reliably (that may be because I was trying it with an anonymous function). Then I[email protected]/msg00087.html run! and that seems nice and easy. It seems to work now. Will it continue to do what I want? What's the difference? They both make a reaction with auto-run set to true. That's as much as I can understand from looking at the source. Thanks!


track! identity keeps the reaction same if used inside a Reactive context, like component render fn body. If you had run! in render fn, it would start new one each render.


Ok, thank you! I think I understand. It sounds like run! will work perfectly for how I'm using it.