While writing the tests for #185, it was found that sometimes the mutation observer will get a duplicate of an element (usually when it is now catching up to multiple events that happened in the app).
I believe this is something that only happens in tests, and possible a side-effect of how jest / jsdom / testing-library work.
Summary
While writing the tests for #185, it was found that sometimes the mutation observer will get a duplicate of an element (usually when it is now catching up to multiple events that happened in the app).
I believe this is something that only happens in tests, and possible a side-effect of how jest / jsdom / testing-library work.
If that isn't the case, we should update the logic here: https://github.com/Tram-One/tram-one/blob/ce276262871c0476a23a34f5da05f7a9a7e9d99b/src/mutation-observer.ts#L90-L102
We should see this happening in apps after #185 and we see
useStores
hooks not cleaning up when they have been removed.