mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-20 09:11:33 +01:00
Clarify assertion failure for incorrect send usage (#151)
* Clarify assertion failure for incorrect send usage * Update ViewStore.swift * Update Sources/ComposableArchitecture/Store.swift Co-authored-by: Dante Broggi <34220985+Dante-Broggi@users.noreply.github.com> * Update Sources/ComposableArchitecture/Store.swift Co-authored-by: Stephen Celis <stephen@stephencelis.com> Co-authored-by: Dante Broggi <34220985+Dante-Broggi@users.noreply.github.com> Co-authored-by: Stephen Celis <stephen@stephencelis.com>
This commit is contained in:
@@ -78,6 +78,10 @@ public final class ViewStore<State, Action>: ObservableObject {
|
||||
/// Sends an action to the store.
|
||||
///
|
||||
/// `ViewStore` is not thread safe and you should only send actions to it from the main thread.
|
||||
/// If you are wanting to send actions on background threads due to the fact that the reducer
|
||||
/// is performing computationally expensive work, then a better way to handle this is to wrap
|
||||
/// that work in an `Effect` that is performed on a background thread so that the result can
|
||||
/// be fed back into the store.
|
||||
///
|
||||
/// - Parameter action: An action.
|
||||
public func send(_ action: Action) {
|
||||
|
||||
Reference in New Issue
Block a user