ngrx-store-logger
ngrx-store-logger copied to clipboard
Added action filtering by function
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/');
}
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! 👍