Skip to content
Discussion options

You must be logged in to vote

We detailed all of these changes in this discussion, but the tldr is that while the previous syntax seemed great, there were a lot of gotchas that you can fall into, and people often did. So we had to change things.

Also, FWIW you should be able to simplify your chain of onChanges with something like this:

BindingReducer()
  .onChange(
    of: { ($0.query.dateRange, $0.query.someProperty1, $0.query.someProperty2, $0.query.someProperty3) },
    removeDuplicates: ==
  ) { _, _ in
    Reduce { _, _ in 
      return .task { .loadInfo } 
    }
  }

However, it looks like we are missing the removeDuplicates variation of onChange and so it may be worth adding that. Too bad tuples aren't equatable…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@saroar
Comment options

@mbrandonw
Comment options

Answer selected by darrarski
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@mbrandonw
Comment options

@salavert
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
5 participants