wip
This commit is contained in:
parent
2dc41c2013
commit
8568b1afa6
|
@ -42,6 +42,9 @@ final class Store<State: Stateable, Action: Codable>: ObservableObject {
|
||||||
|
|
||||||
// Run reducers/middlewares
|
// Run reducers/middlewares
|
||||||
func dispatch(_ action: Action) {
|
func dispatch(_ action: Action) {
|
||||||
|
if !Thread.isMainThread {
|
||||||
|
print("❌WARNING!: AppStore.dispatch should be called from the main thread")
|
||||||
|
}
|
||||||
serialQueue.sync { [weak self] in
|
serialQueue.sync { [weak self] in
|
||||||
guard let wSelf = self else { return }
|
guard let wSelf = self else { return }
|
||||||
let newState = wSelf.dispatch(wSelf.state, action)
|
let newState = wSelf.dispatch(wSelf.state, action)
|
||||||
|
|
Loading…
Reference in a new issue