Skip to content

Commit

Permalink
Move the setting of the store observable's value of of the locked area
Browse files Browse the repository at this point in the history
  • Loading branch information
Qata committed Dec 27, 2016
1 parent 02bfb1e commit 2b100ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/CoreTypes/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public class Store<ObservableProperty: ObservablePropertyType>: 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...) {
Expand Down

0 comments on commit 2b100ce

Please sign in to comment.