Skip to content

Commit 0de1a3f

Browse files
authored
Merge pull request #22 from magma-media/master
allow dispatching actions as an array, without removing ability to dispatch with list of actions as arguments
2 parents 20ea919 + 2beab4c commit 0de1a3f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/CoreTypes/Store.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ open class Store<ObservableProperty: ObservablePropertyType> {
2525
self.middleware = middleware
2626
}
2727

28-
open func dispatch(_ actions: Action...) {
28+
open func dispatch(_ actions: [Action]) {
2929
actions.forEach { action in
3030
let dispatchFunction: (Action...) -> Void = { [weak self] (actions: Action...) in
3131
actions.forEach { self?.dispatch($0) }
@@ -36,6 +36,10 @@ open class Store<ObservableProperty: ObservablePropertyType> {
3636
}
3737
}
3838

39+
open func dispatch(_ actions: Action...) {
40+
self.dispatch(actions)
41+
}
42+
3943
@discardableResult
4044
open func dispatch<S: StreamType>(_ stream: S) -> SubscriptionReferenceType where S.ValueType: Action {
4145
let disposable = stream.subscribe { [unowned self] action in

0 commit comments

Comments
 (0)