Skip to content

(newb) Beginner questions #99

Answered by raquo
yatesco asked this question in Q&A
Jun 22, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Endless event streams?

As you suspected, streams only notify whatever consumers they have the moment they receive the event. After that, the event is forgotten. Signals on the other hand always keep a reference to their current value, which is basically the last event that the signal emitted. So when you add a new consumer to a signal (e.g. by means of addObserver), it will not only be notified about future events, but will also immediately receive the signal's current value (if you don't want that, add the consumer to signal.changes instead). So as you see neither signals nor streams "grow", over time they are the same size as when they started.

Signals/Vars or Event streams?

Signals…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@raquo
Comment options

@yatesco
Comment options

Answer selected by yatesco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #98 on June 23, 2021 01:01.