         subscriptions = subscriptions.filter { $0.subscriber !== subscriber }
     }
     
+    private func publishStateChange(subscriber: AnySubscriber?, selector: ((ReactorState) -> Any)?) {
+        if let selector = selector {
+            subscriber?._update(with: selector(self.state))
+        } else {
+            subscriber?._update(with: self.state)
+        }
+    }
+    
     // MARK: - Events
     
     public func fire(event: Event) {

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

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

        }
    }
  
  
    public init(state: ReactorState, middlewares: [AnyMiddleware] = []) {
        self.state = state
