Closed jhwheeler closed 1 week ago
Hi,
The Chat GPT answer is accurate, it's true for all kind of event dispatcher systems, not just the Stream JS client. But since performance gains are so minuscule, at the end it comes down to personal/team preference. So you can go with either approach.
@szuperaz Great, thank you for the quick and clear response!
Is it better to have multiple listeners on a channel, each one listening to a different event, or one listener that listens to all events and then filter w/ if statements? I have seen both patterns in the docs, and I want to know which is better for performance.
For example, here is some Svelte code:
Would it be better for performance to instead have this:
I asked GPT about this, and its concluding statement was:
Is this accurate?
Thanks in advance!