2 ms·
Thanks, that sounds like the right approach. I don't need to react to all DOM changes, but I have one jolly callback for changes to my one big happy god-owns-th
by DonHopkins 7y ago
Thanks, that sounds like the right approach. I don't need to react to all DOM changes, but I have one jolly callback for changes to my one big happy god-owns-the-user-owns-the-world object (the observable), but the component has view-level properties like hiding and showing details, zoom and pan, etc, that aren't in the observable model, and I'd still like to redraw the canvas when they change. It doesn't take long to draw, but I just don't want to miss any updates, or have to pepper the code with explicit calls to redraw it every time I think something might have changed (causing a lot of pointless redrawing).
Fortunately my app is simple enough that I can just redraw everything whenever something changes, as long as I'm not doing it 37 extra times.