I have a code project library that had a global atom to service a web component. That design had a fault that, having one global atom, it couldn’t service multiple components on the same page. In redesigning to allow each component to have it’s own state, I realized this could be my first opportunity to employ dynamic scope to give each component its own copy of the atom. But somewhere in the flow of functions I am losing my binding, possibly when using an anonymous function in an on-click that should change the once-global atom.
Has anyone dealt with this situation? Any tips on refactoring a global atom to a dynamic one?