DEV Community

Discussion on: Building a Reactive Library from Scratch

Collapse
 
mehuge profile image
Mehuge

The dependencies need to remain so that if a signal happens it will trigger a reaction?

Thread Thread
 
ryansolid profile image
Ryan Carniato

Yes that too. That's probably the more foundational answer. The reason we do cleanup each time is it lets our dependencies be dynamic. There are optimizations to be done around this but this is the core mechanism that you will find in MobX or Vue, along with Solid.