 extension MiddlewareType {
   func apply(_ reduce: @escaping ActionTypeErasedReduceFunction) -> ActionTypeErasedReduceFunction {
     { tuple in
-      guard let typedTuple = tuple as? ReduceTuple else {
-        return reduce(tuple)
-      }
+      guard let typedTuple = tuple as? ReduceTuple else { return reduce(tuple) }
 
       let typedReduce: (ReduceTuple) -> ActionTypeErasedReduceTuple = { typedTuple in
         // We know that we can cast the typed action to ReduxTypes.ActionType

  convenience init(
    initialState: ReduxTypes.StateType,
    reducers: [ReduxTypes.ReduceFunction],
    middlewares: [(@escaping ReduxTypes.ReduceFunction) -> ReduxTypes
      .ReduceFunction] = []
  ) {
    self.init(initialState: initialState)


class ActionEmitter {
  let observable: Observable<ReduxTypes.ActionType>

  init() { self.observable = self.subject.asObservable().observeOn(self.scheduler) }

  func typedEmit<T>() -> (T) -> Void {{ (action: T) in self.subject.onNext(action) } }

  func terminate() { self.subject.onCompleted() }

