Skip to content
Discussion options

You must be logged in to vote

Ok, I was stupid, my problem was that I wasn't handling the action mapping properly.

Instead of this:

    func whisper<DestinationState, DestinationAction>(
        _ store: Store<DestinationState?, PresentationAction<DestinationAction>>,
        state toWhisperState: @escaping (DestinationState) -> Whisper.State?,
        action fromWhisperAction: @escaping (Whisper.Action) -> DestinationAction
    ) -> some View {
        self.modifier(
            WhisperViewModifier(
                store: store.scope(
                    state: {
                        $0.flatMap(toWhisperState)
                    },
                    action: {
                        switch $0 {

Replies: 5 comments 3 replies

Comment options

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

Comment options

You must be logged in to vote
2 replies
@tgrapperon
Comment options

@WedgeSparda
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by WedgeSparda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants