Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve event re-emitter logic across codebase #26383

Open
MidhunSureshR opened this issue Oct 17, 2023 · 1 comment
Open

Improve event re-emitter logic across codebase #26383

MidhunSureshR opened this issue Oct 17, 2023 · 1 comment
Labels
A-Developer-Experience A-Technical-Debt O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience T-Enhancement

Comments

@MidhunSureshR
Copy link
Member

Your use case

What would you like to do?

See matrix-org/matrix-js-sdk#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

@robintown
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Developer-Experience A-Technical-Debt O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience T-Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants