 }
 
 
+
+// MARK: - Reactor
+
 public class Reactor<ReactorState: State> {
-    
-    /**
-     An `EventEmitter` is a function that takes the state and a reference
-     to the reactor and optionally returns an `Event` that will be immediately
-     executed. An `EventEmitter` may also use its reactor reference to perform
-     events at a later time, for example an async callback.
-     */
-    public typealias EventEmitter = (ReactorState, Reactor<ReactorState>) -> Event?
-    
-    // MARK: - Properties
     
     private var subscriptions = [Subscription<ReactorState>]()
     private var middlewares = [Middlewares<ReactorState>]()
-    
-    
-    // MARK: - State
-    
     private (set) var state: ReactorState {
         didSet {
             subscriptions = subscriptions.filter { $0.subscriber != nil }

public struct Middlewares<ReactorState: State> {
    private(set) var middleware: AnyMiddleware
}

public protocol AnySubscriber: class {
    func _update(with state: Any)

        middlewares.forEach { $0.middleware._process(event: event, state: state) }
    }
    
    public func fire(command: AnyCommand) {
        command._execute(state: state, reactor: self)
    }
    
}
