Skip to content

Reducer lifecycle #3561

Answered by mbrandonw
nrkrishna asked this question in Q&A
Jan 21, 2025 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @nrkrishna, this situation is no different from how SwiftUI works with structs conforming to the View protocol. The struct representation of views are created thousands of times while your app is running. It is not a problem to do so.

You should not think of the struct representation of your feature's reducer as representing the feature's lifecycle. Instead the real life cycle is handled by modeling the presentation and dismissal of features as optional/enum state, and then using the navigation tools that come with the library.

Replies: 1 comment 1 reply

Comment options

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

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