Skip to content

Commit

Permalink
Fix issue with empty refined actions locking up store
Browse files Browse the repository at this point in the history
  • Loading branch information
Qata committed Jun 29, 2021
1 parent e00042f commit f834827
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion Sources/RecombinePackage/Store/BaseStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public class BaseStore<State: Equatable, RawAction, RefinedAction>: StoreProtoco
.map { actions, previousState in
actions.flatMap { middleware.transform(previousState, $0) }
}
.filter { !$0.isEmpty }
.scan(state) { state, actions in
actions.reduce(state, reducer.reduce)
}
Expand Down
3 changes: 2 additions & 1 deletion Tests/RecombineTests/StoreMiddlewareTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class StoreMiddlewareTests: XCTestCase {
publishOn: ImmediateScheduler.shared
)
let action = TestFakes.SetAction.string("OK")
store.dispatch(raw: action)
store.dispatch(refined: [])
store.dispatch(refined: action)

XCTAssertEqual(store.state.value, "OK First Middleware Second Middleware")
}
Expand Down

0 comments on commit f834827

Please sign in to comment.