-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add ignoreActions option to createDebugBundle #59
Add ignoreActions option to createDebugBundle #59
Conversation
Thought there might have been an issue, but I think it's all good! |
I was thinking logIdle should remain for code bases that are already using that, but maybe with this approach, logIdle could be removed and users should just include 'APP_IDLE' in ignoreBundles if they want to skip it? |
what if instead of a list (or the // a single action
createDebugBundle({
actionFilter: action => action.type !== 'APP_IDLE'
}) // a list of actions
createDebugBundle({
actionFilter: action => ['SOME_ACTION', 'SOME_OTHER'].includes(action.type)
}) // only log a certain action you care about
createDebugBundle({
actionFilter: action => action.type === 'BLAH'
}) // actions without payloads
createDebugBundle({
actionFilter: action => !action.payload
}) |
I went ahead and did the actionFilter approach, but wanted to give you credit for the idea so I merged this, but modified it a bit. Thanks @malbonesi! |
Ah very cool. For what it's worth, it feels a little strange having to use a function to configure something like this, but I don't actually have a different solution and this certainly offers the most control. In any case, thanks for merging (and for this lib in general)! It looks like the documentation piece I added in docs/api/included-bundles.md is still there, btw :) |
I hear ya, but the whole thing is for debugging so I think passing a function is pretty reasonable. It lets you do whatever. Write it once and forget it. Or you can customize it if you're trying to focus in on just a few things. |
Yeah right on. Thanks :) |
Along the lines of ignoring APP_IDLE events, I thought this might be useful for other custom actions that are dispatched often.
createDebugBundle({ignoreActions: ['GEOLOCATION_SUCCESS']})