-
-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console Group Rework #68
Conversation
@pl12133 Thanks for picking this up so quickly! |
@peteruithoven No problem! Your reference to Your issue actually made me realize a larger issue: the |
I notices the following commit message:
Because it's coupled with a few other changes I'm having a hard time estimating how this will work. Doesn't the undoable handle all actions, so it can store them in history? Or are logging all actions except the ones that are ignored (by the filter function)? |
I think we're thinking of slightly different cases here, I'll give some examples to show the two different cases I have in mind. Example 1: Undoable root reducerimport {combineReducers} from 'redux';
import reducerA from 'reducerA';
import reducerB from 'reducerB';
import undoable from 'redux-undo';
const rootReducer = combineReducers({
reducerA,
reducerB
});
export default undoable(rootReducer) Example 2: Undoable child reducerimport {combineReducers} from 'redux';
import reducerA from 'reducerA';
import reducerB from 'reducerB';
import undoable from 'redux-undo';
const rootReducer = combineReducers({
undoable(reducerA),
reducerB
});
export default rootReducer If I understand you correctly you are thinking of Example 1 but I was adressing a bug that occurs in Example 2. So in Example 2, if the Hopefully that clarifies what I meant in my commit message 😸 |
Looking good! |
…gging, as in `redux-logger`. Reword debug messages. 2. Reorganize debug messages so that `console.group` does not intercept user calls to `console.log`. 3. When `debug` is true, actions which cause no state change should not be logged to the console.
b531e61
to
628e6cd
Compare
Fast-forwarded and squashed commits. |
Although the code looks good and I understand why you came to this, I'm not sure if that is prefereble. When not working on your reducers debug is probably off right? And then when you turn it on, I would like to be informed of all actions that are passed into my reducer, also those that do not result in insertions in our history. I kinda liked our "side effect" that showed: "not insterted: unchanged state"... |
Logging or not logging depending on whether the actions are related to the undoable reducer seems like a separate issue? Maybe we could move that to a separate pull request? I'm actually of the opinion that it should be optional, it is useful to see for example when tweaking the filter function. |
Well this PR is changing that logic so it might be handy to discuss here right? Otherwise we get another PR that might change it back and we've got a more confusing git history. |
The problem with displaying all actions that go through an undoable reducer is that every time an action occurs the undoable reducer will only be able to print its piece of the state, not the entire state tree. If a users wants to just view |
Fair point. I think you're right 👍. It could be useful to add some docs about logging then. In which cases you need redux-logger for example. |
Yes, that is correct and a good point. |
Showing the I someone would like to include them one could always manually console log the actions passed into the reducer.. |
Is this something we would like to do before merging this? Otherwise this is good to go right? |
I believe this is fine to be merged. With the each action handled by an |
Sorry it has taken me so long - thanks a lot! 😁 I released beta7 so feel free to try it out and let me know if it works 😉 |
Address #66 by grouping arguments together and calling
console.group
once all the arguments are available.