Open MidhunSureshR opened 1 year ago
Big +1 for observables. While our current pattern of using events and raw fields certainly gets the job done, it defies all attempts to capture the pattern in a single type. This leads to a lot of boilerplate, for both data producers, transformers, and consumers, which in turn equals lots of potential for bugs.
Your use case
What would you like to do?
See https://github.com/matrix-org/matrix-js-sdk/pull/3796
We should examine if this sort of issue happens in other parts of the codebase.
Why would you like to do it?
Lots of potential to cause bugs. We should have a better way of listening to changes on objects that isn't based on manually setting up re-emitter logic.
How would you like to achieve it?
Requires deliberation, but observables (eg: https://rxjs.dev/) may make sense. For example, we could have an observable map of users that the memberlist would subscribe to.
Have you considered any alternatives?
No response
Additional context
No response