Replies: 1 comment 1 reply
-
I'd introduce a local variable |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey good people!
I have a
Reducer
that starts a long running effect when the view appears (with SwiftUI's .task modifier)The rationale behind all that is that I want to fetch an initial batch of data, but also to subscribe to notifications from
objCreatedAsyncStream
and when an event is emitted, refresh the data.I was able to test the initial fetching of data using
TestStore
but when I try to test the long running effect I'm facing issues. I want to return an empty array of objs fromeffA
and onceobjCreatedAsyncStream
emits an event, return an array with some objects.I thought that I could swap the dependency that fetches the data during the test, but it seems that swapping a dependency with a long running effect, is not supported.
Any ideas on how to approach this?
Beta Was this translation helpful? Give feedback.
All reactions