     /// Emit change to any listeners
     public func emitChange() {
         self.eventEmitter.emit(StoreChangeEvent)
+    }
+
+    /// Wait for all actions registered in a store
+    public func waitFor<T: Action>(actionType: T.Type) {
+        self.dispatcher.waitFor(self.actionIds, actionType: actionType)
     }
 
     public func unregister() {

    private let eventEmitter : EventEmitter
    private var lastId = 1

    private var subscriptions : [String:EventSubscription] = [:]
    private var actionIds : [String] = []

    public var state : State {
        didSet {


    /// Bind an Action to a Handler
    public func bindAction<T: Action>(actionType: T.Type, handler: (T) -> ()) -> String {
        let id = self.dispatcher.register(actionType, handler: handler)
        self.actionIds.append(id)
        return id
    }

    /// Unbind an Action
    public func unbindAction(identifier: String) {
        self.dispatcher.unregister(identifier)
        if let index = self.actionIds.indexOf(identifier) {
            self.actionIds.removeAtIndex(index)
        }
    }
    
    /// Register StoreListener that listen to changes of this store
