External actions to influence state #509
-
Have thoroughly studied the architecture and currently am trying to understand how could an external non user driven effect be managed fed back into the store. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@DavidKmn This is where the environment comes into play. We have a web socket example here: It uses a |
Beta Was this translation helpful? Give feedback.
@DavidKmn This is where the environment comes into play. We have a web socket example here:
https://github.com/pointfreeco/swift-composable-architecture/blob/4449bc2e249ba909086271d37b98f54e0ce725e3/Examples/CaseStudies/SwiftUICaseStudies/02-Effects-WebSocket.swift
It uses a
connectButtonTapped
to kick things off, but you could also tie it to a lifecycle event likeonAppear
orapplicationDidFinishLaunching
.