AdamBrodzinski / meteor-flux-leaderboard

Flux Example with React & Meteor
131 stars 19 forks source link

Version with Alt.js timetravel #12

Closed rdewolff closed 8 years ago

rdewolff commented 8 years ago

How do you enable the timetravel extension of Chrome to work ?

cf. https://github.com/goatslacker/alt-devtool

Seems there are some packages to add for this to work properly?

AdamBrodzinski commented 8 years ago

If you're using the older version of Alt you'll need to import it like this:

https://github.com/goatslacker/alt-devtool/tree/3b1c738d2ce1edfaad5101afcc82515285d05a46

I've switched to Redux and it's a far better debugger IMHO

rdewolff commented 8 years ago

Am still hesitating between Alt.js or Redux's implementation's of Flux!

rdewolff commented 8 years ago

What tool do you use with Redux?

AdamBrodzinski commented 8 years ago

It's built in, it's a react component itself :smile:

https://github.com/gaearon/redux-devtools

btw, ctrl + h will hide it

It's 10x easier than Alt, i need to migrate one of my alt apps soon

rdewolff commented 8 years ago

https://github.com/gaearon/redux-devtools ! Found it at the same time you write! Thanks for being so fast :)

rdewolff commented 8 years ago

Lemme test with your meteor-flux-leaderboard version on the redux branch.

AdamBrodzinski commented 8 years ago

yea also btw, i don't know if that has an if/else block for devtools but this is how i do it (this is prob a newer version too)

const reducer = combineReducers({
  router: routerStateReducer,
});

if (__DEV__) {
  store = compose(
    reduxReactRouter({ createHistory }),
    devTools(),
  )(createStore)(reducer);
  window._store = store;

}
else {
  store = compose(
    reduxReactRouter({ createHistory }),
  )(createStore)(reducer);
}

export const dispatch = store.dispatch;

so that way devtools isn't in production!

rdewolff commented 8 years ago

Yeah I had seen a similar code, either in our talk on the meteor forum, on a blog post or on some github conversion like we're having here.

Thanks for the help!