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:
Brandon Williams
2020-05-29 09:30:56 -07:00
committed by GitHub
parent a20b0b1d6a
commit f25878c01f
2 changed files with 13 additions and 1 deletions

View File

@@ -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) {