var assign = require("react/lib/Object.assign");

var _listeners = [];
var _state = {};

var EditorStore = {
  set(state, notify) {
    notify = notify !== false;
    _state = assign(_state, state);
    if (notify) { this.notify(); }
  },

  get() {
    return _state;
  },

  addChangeListener(onChange) {
    _listeners.push(onChange);
  },

  removeChangeListener(onChange) {
    var index = _listeners.indexOf(onChange);

    if (index > -1) {
      _listeners.splice(index, 1);
    }
  },

  notify() {
    _listeners.forEach((onChange) => onChange(this));
  }
};

module.exports = EditorStore;

@@ -41,16 +41,53 @@
 ssign%22);
+%0Avar pick   = require(%22lodash.pick%22);
 %0A%0Avar _l
@@ -117,16 +117,35 @@
 te = %7B%7D;
+%0Avar _changed = %5B%5D;
 %0A%0Avar Ed
@@ -175,22 +175,20 @@
 te, 
-notify
+emit
 ) %7B%0A    
 noti
@@ -187,23 +187,19 @@
     
-notify = notify
+emit = emit
  !==
@@ -250,18 +250,51 @@
     
-if (notify
+_changed = Object.keys(state);%0A    if (emit
 ) %7B 
@@ -298,22 +298,20 @@
  %7B this.
-notify
+emit
 (); %7D%0A  
@@ -349,16 +349,74 @@
 ;%0A  %7D,%0A%0A
+  getChanged() %7B%0A    return pick(_state, _changed);%0A  %7D,%0A%0A
   addCha
@@ -633,14 +633,12 @@
 %0A%0A  
-notify
+emit
 () %7B

add method to only get changes from last store change