Pervious ParseTCA, I created some encapsulation to reproduce how TCA to implement in binding to ViewStore and Store.
Today, I will try to refactor them to more complete, like composable action and flexibility.
Refocator Reducer
// refactor after:
typealias Reducer<State, Action> = (inout State, Action)-> AnyPublisher<Action, Never>?
Refactor Store
/// refactor after:
func send(action: Action) {
guard let effect = void(&publisher.value, action) else { return }
effect
.sink(receiveValue: send)
.store(in: &bag)
}