Skip to content

Commit f834827

Browse files
committedJun 29, 2021
Fix issue with empty refined actions locking up store
1 parent e00042f commit f834827

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎Sources/RecombinePackage/Store/BaseStore.swift

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public class BaseStore<State: Equatable, RawAction, RefinedAction>: StoreProtoco
6767
.map { actions, previousState in
6868
actions.flatMap { middleware.transform(previousState, $0) }
6969
}
70-
.filter { !$0.isEmpty }
7170
.scan(state) { state, actions in
7271
actions.reduce(state, reducer.reduce)
7372
}

‎Tests/RecombineTests/StoreMiddlewareTests.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ class StoreMiddlewareTests: XCTestCase {
1616
publishOn: ImmediateScheduler.shared
1717
)
1818
let action = TestFakes.SetAction.string("OK")
19-
store.dispatch(raw: action)
19+
store.dispatch(refined: [])
20+
store.dispatch(refined: action)
2021

2122
XCTAssertEqual(store.state.value, "OK First Middleware Second Middleware")
2223
}

0 commit comments

Comments
 (0)
Please sign in to comment.