-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
33 lines (26 loc) · 951 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function _interceptActions(Reflux) {
var _createActionsFn = Reflux.createActions;
Reflux.createActions = function(actions) {
var _createActions = _createActionsFn(actions);
Object.keys(_createActions).map(function(action){
_createActions[action].listen(function(payload) {
var p = payload && payload.toJS ? payload.toJS() : payload;
console.log('reflugger', 'action:' + action, p);
});
});
return _createActions;
};
}
function _interceptStore(Reflux) {
var _createStoreFn = Reflux.createStore;
Reflux.createStore = function(store) {
var _createStore = _createStoreFn(store);
return _createStore;
};
}
var reflugger = function(Reflux) {
console.log('%creflugger', 'color:white; background-color:#a074ab; font-size: 22px');
_interceptActions(Reflux);
_interceptStore(Reflux);
};
module.exports = reflugger;