Skip to content

Commit

Permalink
Change Middleware's dispatch function from accepting arrays to variadic
Browse files Browse the repository at this point in the history
  • Loading branch information
Qata committed Jul 2, 2021
1 parent 6b12553 commit df3250e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/RecombinePackage/Middleware.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Combine
/// Refined actions produced by Middleware are then forwarded to the main reducer.
public struct Middleware<State, Action> {
/// A function to dispatch actions such that they flow through all of the `Middleware` again.
public typealias Dispatch = ([Action]) -> Void
public typealias Dispatch = (Action...) -> Void
public typealias Function = (State, Action, Dispatch) -> [Action]
internal let transform: Function

Expand Down
2 changes: 1 addition & 1 deletion Tests/RecombineTests/StoreMiddlewareTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class StoreMiddlewareTests: XCTestCase {
switch action {
case let .string(value):
if !value.contains("Middleware") {
dispatch([.string(value + " Middleware")])
dispatch(.string(value + " Middleware"))
return []
}
default:
Expand Down

0 comments on commit df3250e

Please sign in to comment.