Stream onStart behavior
Playground link: https://effect.website/play#327266c625eb
I would naively expect Stream.onStart to call its effect after the stream is initialized (and the event listeners are registered), but it doesn't appear to be the case. In my scenario, my stream relies heavily on event emitters, and I want to execute a "post-initialization" effect which emits events, but only after the event listeners are registered. Is there a better alternative? I have been getting around this by doing:
but was just curious if there's a better way? thanks again!
I would naively expect Stream.onStart to call its effect after the stream is initialized (and the event listeners are registered), but it doesn't appear to be the case. In my scenario, my stream relies heavily on event emitters, and I want to execute a "post-initialization" effect which emits events, but only after the event listeners are registered. Is there a better alternative? I have been getting around this by doing:
but was just curious if there's a better way? thanks again!
