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

Debugging a shared stream which doesn't emit a value when expected #319

Open
jbhoot opened this issue Oct 23, 2024 · 0 comments
Open

Debugging a shared stream which doesn't emit a value when expected #319

jbhoot opened this issue Oct 23, 2024 · 0 comments

Comments

@jbhoot
Copy link

jbhoot commented Oct 23, 2024

I've observed a few scenario when this happens:

  1. The stream hasn't been 'subscribed' yet using the associated use hook.
  2. The stream was subscribed with the associated use hook, but the component in which the subscription lived, was unmounted by the time I expected the stream to emit a value. This can be alleviated somewhat with a <Subscribe> component.
  3. Values in the stream passes through a filter operation. For example, I use a parsedValue$$->validValue$$ stream, which filters out Error(e) values, and lets only Ok(v) pass through. Now, often, validValue$$ stream doesn't produce a value when I expect it to. This happens mostly during a formSubmit, where the stream that processes a formSubmit event checks that validValue$$ streams of all of the input value have a latest valid value.

Now, I know all of the 3 points are on me. As in, I need to ensure that the subscription is alive, and that I am responsible for the logic in parsed$$->valid$$.

But examining what went wrong feels like drudgery. Are there ways to make it easy? I am just looking for ideas in case someone has experienced this.

My experience with RxJS is also limited to just react-rxjs. In general, do you recommend rxjs marbles to test and debug rxjs streams? or something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant