Skip to content
Discussion options

You must be logged in to vote

Hi @tisohjung! Version 1.4 introduced "case key path" overloads for ifLet, which unfortunately expands the type checking space enough to cause regressions like this. While we will be able to remove these overloads in 2.0, we cannot make breaking changes till then.

In the meantime, you can extract these helpers to a dedicated place to improve compile times:

extension Reducer where State == Feature1.State, Action == Feature1.Action {
  func subFeatures() -> some ReducerOf<Self> {
    self
      .ifLet(\.subFeature1, action: /Action.subFeature1) { SubFeature1() }
      .ifLet(\.subFeature2, action: /Action.subFeature2) { SubFeature2() }
      .ifLet(\.subFeature3, action: /Action.subFeature3) {

Replies: 1 comment 1 reply

Comment options

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

Answer selected by tisohjung
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
Converted from issue

This discussion was converted from issue #2724 on January 25, 2024 05:54.