jkzing / vscode-redux-devtools

Redux DevTools vscode extension
MIT License
81 stars 10 forks source link

state is undefined #3

Closed radziksh closed 5 years ago

radziksh commented 7 years ago

I installed the application, configured the port, but can not see anything in the state. Restart does not help.

environment: vsCode 1.12.1 typescript: 2.3.2 node: 7.4.0 webpack: 2.5.1

Screenshots: screenshot_142 screenshot_143 screenshot_144

jkzing commented 7 years ago

Um...it seems you didn't have a remotedev server running on your localhost, and you did not compose your remote-redux-devtools middleware as well.

Please try following steps to setup:

  1. npm install remotedev-server remote-redux-devtools --save-dev
  2. create a file named remotedev.js (or any name you want)
  3. in remotedev.js:

    const remotedev = require('remotedev-server');
    
    remotedev({
      hostname: 'localhost',
      port: 8080,
    });
  4. run remotedev.js in shell
    node remotedev.js
  5. in your configureStore.js:

    import {createStore, applyMiddleware} from 'redux';
    import {composeWithDevTools} from 'remote-redux-devtools';
    
    let compose = composeWithDevTools({
      realtime: true,
      name: 'Your Instance Name',
      host: 'localhost',
      port: 8080, 
    });
    
    const store = createStore(
      yourReducer,
      compose(
          applyMiddleware(...),
          persistState(...)
      )
    );
  6. open your react-redux app in browser
  7. open vscode-redux-devtools in vscode