Skip to content

Commit ef73e9e

Browse files
committed
Change dispatch from using flatMap + forEach to using two forEach statements instead
1 parent 8e6109e commit ef73e9e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/CoreTypes/Store.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ open class Store<ObservableProperty: ObservablePropertyType> where ObservablePro
2525
}
2626

2727
public func dispatch(_ actions: Action...) {
28-
actions.flatMap { action in
29-
middleware.transform({ self.observable.value }, self.dispatch, action)
30-
}.forEach { action in
31-
observable.value = reducer.transform(action, observable.value)
28+
actions.forEach { action in
29+
middleware.transform({ self.observable.value }, self.dispatch, action).forEach { action in
30+
observable.value = reducer.transform(action, observable.value)
31+
}
3232
}
3333
}
3434

0 commit comments

Comments
 (0)