Coder Social home page Coder Social logo

Comments (4)

zalmoxisus avatar zalmoxisus commented on May 11, 2024

I see. I'm wondering what would be best: not to show this warning at all or to have an autoReconnect parameter (which would be true by default).

What do you think?

from remote-redux-devtools.

ColCh avatar ColCh commented on May 11, 2024

Remote dev tool connects at app load, so it will display warning at each app load...

May be make a onError handler?

from remote-redux-devtools.

ColCh avatar ColCh commented on May 11, 2024

So, main aim was prevent any error if dev server is off (we start it on demand, not every dev session)

We use react-native and don't always debug our code with Chrome debugger (tests are enough). And in rare cases use redux dev tools.

And this code chunk (it's a bit dirty) handled it. Starting monitoring by redux action (and filter it out). After store creation try to connect to dev server. If it's running, start redux remote dev tools monitoring.

// store enhancer. may be modified by redux dev tools later
let enhancer = applyMiddleware(thunk);

/**
 * Redux remote dev tools
 */
if (__DEV__) {  
  const reduxDevToolsOptions = {
    port: 8000,
    startOn: `##REDUXDEVTOOL_START`,
    realtime: false,
    filters: { blacklist: [`##REDUXDEVTOOL_START`, ], }
  };
  const reduxDevTools =  devTools(reduxDevToolsOptions);

  enhancer = compose(enhancer, reduxDevTools);
}

// initialize store here...

/**
 * Workaround for redux dev tools, it sends error if can't reach dev server
 * Let's not it start otherwise!
 */
if (__DEV__) {
  var ws = new WebSocket('ws://localhost:8000/socketcluster/');
  ws.onopen = () => {
    store.dispatch({ type: `##REDUXDEVTOOL_START`, });
    ws.close();
    ws = null;
  };
  setTimeout(() => {
    if (ws) {
      ws.close();
      ws = null;
    }
  }, 3 * 1e3);
}

from remote-redux-devtools.

ColCh avatar ColCh commented on May 11, 2024

I have solved my trouble, and it was not really related to remote-redux-devtools.

I think no actions needed for this case, so @zalmoxisus, I'm closing issue now.

from remote-redux-devtools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.