From 2b100ce1cf0a9c0bc9df842017c437f9bd4a0806 Mon Sep 17 00:00:00 2001 From: Charlotte Tortorella Date: Wed, 28 Dec 2016 09:57:21 +1100 Subject: [PATCH] Move the setting of the store observable's value of of the locked area --- Sources/CoreTypes/Store.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/CoreTypes/Store.swift b/Sources/CoreTypes/Store.swift index 5c28954..c813a87 100644 --- a/Sources/CoreTypes/Store.swift +++ b/Sources/CoreTypes/Store.swift @@ -46,8 +46,9 @@ public class Store: StoreType where guard dispatchingLock.try() else { raiseFatalError("ReSwift:IllegalDispatchFromReducer - Reducers may not dispatch actions.") } - observable.value = reducer.transform(action, observable.value) + let value = reducer.transform(action, observable.value) dispatchingLock.unlock() + observable.value = value } public func dispatch(_ actions: Action...) {