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
struct State: BaseStateProtocol {
}
`enum Action {
case baseAction(BaseAction)
} `
var body: some ReducerProtocol<State, Action> {
Reduce<State, Action> { state, action in
switch action {
case let .baseAction(action):
return baseReduce(&state.baseState, action: action)
}
}
}`
I have a BaseStateProtocol, and my feature state conforms to it. I would like to share my feature state with a 'global' reducer to modify it. What am I doing wrong? Maybe the way I am doing it is incorrect. I need some help. Thanks in advance.
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.
-
Is there any way to share state with a "global" reducer to modify state?
Something like this
protocol BaseStateProtocol { }
func baseReduce(_ state: inout BaseStateProtocol, action: BaseAction) -> Effect<BaseAction> { switch action { } }
And Feature
`struct Feature: ReducerProtocol {
}`
I have a BaseStateProtocol, and my feature state conforms to it. I would like to share my feature state with a 'global' reducer to modify it. What am I doing wrong? Maybe the way I am doing it is incorrect. I need some help. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions