Skip to content
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

Conversation

malbonesi
Copy link
Contributor

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']})

@malbonesi malbonesi closed this Aug 28, 2019
@malbonesi malbonesi deleted the feature/debug-bundle-ignore-actions branch August 28, 2019 12:29
@malbonesi malbonesi restored the feature/debug-bundle-ignore-actions branch August 28, 2019 12:32
@malbonesi malbonesi reopened this Aug 28, 2019
@malbonesi
Copy link
Contributor Author

Thought there might have been an issue, but I think it's all good!

@malbonesi
Copy link
Contributor Author

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?

@HenrikJoreteg
Copy link
Owner

what if instead of a list (or the logIdle) we just took an action filter function that you could provide? Then you can filter out whatever you want, for example:

// 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
})

@HenrikJoreteg HenrikJoreteg merged commit 54705d5 into HenrikJoreteg:master Sep 5, 2019
@HenrikJoreteg
Copy link
Owner

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!

@malbonesi
Copy link
Contributor Author

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 :)

@malbonesi malbonesi deleted the feature/debug-bundle-ignore-actions branch September 5, 2019 20:53
@HenrikJoreteg
Copy link
Owner

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.

@malbonesi
Copy link
Contributor Author

Yeah right on. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants