 
     public var observable: ObservableProperty!
 
-    private var isDispatching = false
+    private let dispatchingLock = NSLock()
 
     private var disposeBag = SubscriptionReferenceBag()
 

 contained within an observable.
 */

public class Store<ObservableProperty: ObservablePropertyType>: StoreType where ObservableProperty.ValueType: StateType {

    public typealias StoreMiddleware = Middleware<ObservableProperty.ValueType>

    }

    private func defaultDispatch(action: Action) {
        guard dispatchingLock.try() else {
            raiseFatalError("ReSwift:IllegalDispatchFromReducer - Reducers may not dispatch actions.")
        }
        observable.value = reducer.run(action: action, state: observable.value)
        dispatchingLock.unlock()
    }

    @discardableResult
