You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to go to NestedView from AnotherNestedView ? I couldn't set a variable for NestedState in AnotherNestedState.
# https://gist.github.com/toomozoo/3a59663baec44dcf0429fa4aa9a31565
struct AnotherNestedState: Equatable, Identifiable {
let id: UUID
var count: Int = 0
var children: IdentifiedArrayOf<AnotherNestedState> = []
// Error: `Value type 'AnotherNestedState' cannot have a stored property that recursively contains it`
// var nestedState: NestedState? = nil
// I can declare this, but `node2` in Action raise `Circular reference`.
var children2: IdentifiedArrayOf<NestedState> = []
}
indirect enum AnotherNestedAction: Equatable {
case append
case buttonTapped
case node(id: AnotherNestedState.ID, action: AnotherNestedAction)
case onAppear
// Error: `Circular reference`
// case node2(id: NestedState.ID, action: NestedAction)
}
And I can't handle some actions like belows:
[OK] NestedView -> AnotherNestedState -> Tap Count up button
[NG] NestedView -> NestedView -> AnotherNestedState -> Tap Count up button
[NG] NestedView -> NestedView -> NestedView -> AnotherNestedState -> Tap Count up button
[?] NestedView -> AnotherNestedState -> NestedView -> AnotherNestedState -> Tap Count up button
I couldn't check this because of error above
First case is fine, but I don't know how to support other cases.
I'm getting actions like below but how to support infinity actions in reducder?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to implement like Twitter navigation that allows users to go back and forth between user pages and tag searches.
I checked 04-HigherOrderReducers-Recursion.swift and could implement one recursive navigation such as:
I updated 04-HigherOrderReducers-Recursion.swift and add AnotherNestedState, but I couldn't implement such as:
How to go to
NestedView
fromAnotherNestedView
? I couldn't set a variable forNestedState
inAnotherNestedState
.And I can't handle some actions like belows:
Count up
buttonCount up
buttonCount up
buttonCount up
buttonFirst case is fine, but I don't know how to support other cases.
I'm getting actions like below but how to support infinity actions in reducder?
Diff 04-HigherOrderReducers-Recursion.swift
Sorry, I'm not good at English 🙇♀️
Beta Was this translation helpful? Give feedback.
All reactions