Skip to content

Added action filtering by function #27

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

solnat
Copy link

@solnat solnat commented May 13, 2018

This pull request adds a way for the user to filter actions by providing a custom filter function instead of string arrays. The previous functionality of filtering with strings is (of course) retained.
In my case, it proved to be useful when working with namespaced actions to allow me to ignore entire namespaces in a concise way.

Before:

const options: LoggerOptions = {
  filter:  {
    blacklist: ['entity/set-value', 'entity/update-value', 
      'entity/do-something', 'entity/some-other-action'
    ]
  }
} 

After:

const options: LoggerOptions = {
  filter: (actionType: string) => !actionType.startsWith('entity/');
}

@btroncone
Copy link
Owner

Sorry for the delay on this, lgtm. Would you mind updating the README to reflect this new option? Once that is done I will merge in, 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