Skip to content

Missing state transitions #903

Answered by lukeredpath
fabfelici asked this question in Q&A
Discussion options

You must be logged in to vote

This behaviour is to reduce the number of unnecessary emissions from the publisher.

#619

If all state mutations occur synchronously there is no need for subscribers to know about intermediate states. Only the end state matters.

In your test, if you have an effect that returns a result immediately it makes complete sense that the state transitions directly from idle to loaded…there was no “loading” state because the load was immediate. To that end the test is correct.

If you want to test the flow from idle to loading to loaded, then it would be more realistic to have an effect that allows you to control when it outputs a value using e.g. a PassthroughSubject, erased to an effect and testin…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by fabfelici
Comment options

You must be logged in to vote
1 reply
@lukeredpath
Comment options

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