Replies: 1 comment
-
Hey @eivindml! Thanks for the discussion. I'm going to kick it over to that section of the repo. We addressed some of these concerns shortly after your post, in the "Adaptive State Management" series of episodes. We hope those episodes helped! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone! 👋🏼
I'm working on a side projects where I'm using the architecture from the video series. Currently I've only worked on the iOS part of the app, and it works great.
I recently started on the macOS app as well, and would love some input/discussion how people would structure this.
Question
Would you write entirely new state and reducers for the new platform? Or extend/modify them so that we can share usage with the macOS target? Or other ideas?
The problem
The problem now is that each framework (for instance
Counter
from the episodes) has the state and reducers coupled with the Views (SwiftUI). And I'm not sharing much of the UI between the platforms. We could refactor this so that state/reducers are separate frameworks from the UI. LikeCounter
andCounterUI
or something. Drawbacks is that we get double the amount if frameworks. Also we will often have state or actions that are only relevant for one of the platforms that will be visible for the other platforms. For instance action:addProjectModalModalDismissed
and stateisAddProjectModalShown
which only is relevant for iOS.Or we can write separate state and reducers for the macOS app. Like a
CounterMacOS
framework. Then we can have state/reducers and UI together, and we don't pollute the other platform with state/actions that aren't relevant, but obviously there are a lot of duplicated code to be written. For instance I have actions that load and save data to CloudKit, that obviously is used on both platforms.Would love some input from anybody on this. What would you do, and why?
🦊💚
Beta Was this translation helpful? Give feedback.
All reactions