Skip to content

Commit

Permalink
Merge pull request #326 from charjac/FIX/DEVTOOLS
Browse files Browse the repository at this point in the history
chore: add react and redux devtool the proper way
  • Loading branch information
nukeop authored May 6, 2019
2 parents 94e6fc8 + 38ab09a commit 325ef5e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 24 deletions.
3 changes: 1 addition & 2 deletions app/store/configureStore.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { createStore, compose, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import ReduxPromise from 'redux-promise';
import { composeWithDevTools } from 'remote-redux-devtools';

import rootReducer from '../reducers';

export default function configureStore(initialState) {
const composeEnhancers = process.env.NODE_ENV === 'production'
? compose
: window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || composeWithDevTools;
: window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;

const store = createStore(
rootReducer,
Expand Down
24 changes: 11 additions & 13 deletions server/main.dev.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// const {
// default: installExtension,
// REACT_DEVELOPER_TOOLS,
// REDUX_DEVTOOLS
// } = require('electron-devtools-installer');
const {
default: installExtension,
REACT_DEVELOPER_TOOLS,
REDUX_DEVTOOLS
} = require('electron-devtools-installer');
const {
app,
ipcMain,
Expand Down Expand Up @@ -47,15 +47,13 @@ function createWindow () {

win.setTitle('Nuclear Music Player');

// Needs to be commented for now
// https://github.com/electron/electron/issues/13008
// installExtension(REACT_DEVELOPER_TOOLS)
// .then((name) => console.log(`Added Extension: ${name}`))
// .catch((err) => console.log('An error occurred: ', err));
installExtension(REACT_DEVELOPER_TOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err));

// installExtension(REDUX_DEVTOOLS)
// .then((name) => console.log(`Added Extension: ${name}`))
// .catch((err) => console.log('An error occurred: ', err));
installExtension(REDUX_DEVTOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err));

win.loadURL(
url.format({
Expand Down
16 changes: 7 additions & 9 deletions server/main.dev.linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { runHttpServer, closeHttpServer } from './http/server';
import { setOption } from './store';
import { registerDownloadsEvents } from './downloads';

// const { default: installExtension, REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } = require('electron-devtools-installer');
const { default: installExtension, REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } = require('electron-devtools-installer');
const getOption = require('./store').getOption;


Expand Down Expand Up @@ -46,15 +46,13 @@ function createWindow() {

win.setTitle('nuclear music player');

// Needs to be commented for now
// https://github.com/electron/electron/issues/13008
// installExtension(REACT_DEVELOPER_TOOLS)
// .then((name) => console.log(`Added Extension: ${name}`))
// .catch((err) => console.log('An error occurred: ', err));
installExtension(REACT_DEVELOPER_TOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err));

// installExtension(REDUX_DEVTOOLS)
// .then((name) => console.log(`Added Extension: ${name}`))
// .catch((err) => console.log('An error occurred: ', err));
installExtension(REDUX_DEVTOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err));

win.loadURL(url.format({
pathname: 'localhost:8080',
Expand Down

0 comments on commit 325ef5e

Please sign in to comment.