7 examples of 'redux devtools extension npm' in JavaScript

Every line of 'redux devtools extension npm' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
6function withDevTools(middleware) {
7 const devTools = window.devToolsExtension
8 ? window.devToolsExtension()
9 : require('../containers/DevTools').instrument();
10 return compose(middleware, devTools);
11}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

9export function _createReduxDevtoolsExtension() {
10 const legacyExtensionKey = 'devToolsExtension';
11 const extensionKey = '__REDUX_DEVTOOLS_EXTENSION__';
12
13 if (typeof window === 'object' && typeof window[legacyExtensionKey] !== 'undefined') {
14 return window[legacyExtensionKey];
15 }
16 else if (typeof window === 'object' && typeof window[extensionKey] !== 'undefined') {
17 return window[extensionKey];
18 }
19 else {
20 return null;
21 }
22}
26function ReduxDevToolsFactory(): boolean {
27 const reduxDevTools = new ReduxDevTools();
28 window[ReduxDevToolsName] = reduxDevTools;
29 return reduxDevTools.IsEnabled;
30}
15constructor(
16 private ngRedux: NgRedux<IAppState>,
17 private devTool: DevToolsExtension) {
18
19 // configure the store here, this is where the enhancers are set
20 this.ngRedux.configureStore(rootReducer, {},
21 isDevMode() ? [createLogger({ collapsed: true })] : [],
22 isDevMode() && devTool.isEnabled() ? [...enhancers, devTool.enhancer()] : [...enhancers]);
23}
448public __actionHookForDevTools(cb: () => any) {
449 this.devToolsHookCb = cb;
450}
34constructor(
35 private devTools: DevToolsExtension,
36 private ngRedux: NgRedux<IAppState>,
37 private ngReduxRouter: NgReduxRouter,
38 private epics: SessionEpics) {
39 middleware.push(createEpicMiddleware(this.EPICS));
40
41 ngRedux.configureStore(
42 rootReducer,
43 {},
44 middleware,
45 devTools.isEnabled() ?
46 [...enhancers, devTools.enhancer()] :
47 enhancers);
48 ngReduxRouter.initialize();
49}
40function showDevTools() {
41 getNWWindow().showDevTools();
42}

Related snippets