mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-24 12:14:25 +01:00
Move send(_:animation:) to ViewStore.swift. (#1075)
This commit is contained in:
@@ -142,6 +142,19 @@ public final class ViewStore<State, Action>: ObservableObject {
|
||||
self._send(action)
|
||||
}
|
||||
|
||||
/// Sends an action to the store with a given animation.
|
||||
///
|
||||
/// See ``ViewStore/send(_:)`` for more info.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - action: An action.
|
||||
/// - animation: An animation.
|
||||
public func send(_ action: Action, animation: Animation?) {
|
||||
withAnimation(animation) {
|
||||
self.send(action)
|
||||
}
|
||||
}
|
||||
|
||||
/// Derives a binding from the store that prevents direct writes to state and instead sends
|
||||
/// actions to the store.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user