Skip to content

Commit

Permalink
Proper use of ObservableObject
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimillian committed Jul 29, 2019
1 parent 92bbd7e commit 7e977b3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Sources/SwiftUIFlux/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import SwiftUI
import Combine

final public class Store<State: FluxState>: ObservableObject {
public let willChange = PassthroughSubject<Void, Never>()

private(set) public var state: State

Expand Down Expand Up @@ -45,7 +44,7 @@ final public class Store<State: FluxState>: ObservableObject {
}

private func _dispatch(action: Action) {
willChange.send()
objectWillChange.send()
state = reducer(state, action)
}
}

0 comments on commit 7e977b3

Please sign in to comment.