Recursive navigation

@nikitaame Recurse needs to go through the full layer of recursion. In the demo example, it goes through children[index] via forEach:

case .node:
  return self.forEach(
    state: \.children,
    action: /NestedAction.node(id:action:),
    environment: { $0 }
  )
  .run(&state, action, environment)

In your case it could go through screenB.screenA via pullback.optional. I think something like:

case let .screenB(.screenA)):
  return self.pullback(
    state: \.screenB.screenA,
    action: (/ScreenAAction.screenB)
      .appending(path: /ScreenBAction.screenA),
    environment: { ... }
  )
  .optional()
  .run(&state, action, environment)
1 Like