forked from 500tech/angular-state-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devTools.js
32 lines (27 loc) · 843 Bytes
/
devTools.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
import { createDevTools} from 'redux-devtools';
import { render } from 'react-dom';
import LogMonitor from 'redux-devtools-log-monitor';
import DockMonitor from 'redux-devtools-dock-monitor';
import React from 'react'
import { Provider } from 'react-redux';
const DevTools = createDevTools(
<DockMonitor toggleVisibilityKey='ctrl-h'
changePositionKey='ctrl-q'>
<LogMonitor theme='tomorrow' />
</DockMonitor>
);
export function runDevTools($ngRedux, $rootScope) {
render(
<Provider store={$ngRedux}>
<div>
<DevTools />
</div>
</Provider>,
document.getElementById('devTools')
);
//Hack to reflect state changes when disabling/enabling actions via the monitor
$ngRedux.subscribe(_ => {
setTimeout($rootScope.$apply.bind($rootScope), 100);
});
}
export default DevTools;