     public func unlisten(identifier: String) {
         if let subscription = self.subscriptions[identifier] {
             self.eventEmitter.removeListenerWithSubscription(subscription)
+            self.subscriptions.removeValueForKey(identifier)
         } else {
             fatalError("Store: listener with id \(identifier) not found")
         }

    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
