Skip to content
Discussion options

You must be logged in to vote

Hi @Muhammed9991, can you explain what you expect to happen from doing something like this:

case . isUsefulButtonTapped:
  state.isUseful = nil
  state.isUseful = true

Do you expect the view store to emit 2 times for each of these changes?

That is not how it works. A function with an inout parameter cannot observe every change made inside the function. It can only observe the final change. Also, the reduce method is completely synchronous and nothing async can be done inside (that is what effects are for). So there doesn't seem to be a reason to observe each change on the inside.

But if you are talking about something else then can you please provide more information?

Replies: 1 comment 1 reply

Comment options

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

Answer selected by Muhammed9991
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