zalmoxisus / redux-devtools-filter-actions

Redux DevTools composable monitor with the ability to filter actions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can this monitor be composable?

gaearon opened this issue · comments

commented

I'm thinking something like this:

import React from 'react';
import { createDevTools } from 'redux-devtools';
import FilterMonitor from 'redux-devtools-filter-actions';
import LogMonitor from 'redux-devtools-log-monitor';

export default createDevTools(
  <FilterMonitor filter={{ blacklist: ['ACTION1', 'ACTION2'], whitelist: ['ACTION1', 'ACTION2'] }}>
    <LogMonitor />
  </FilterMonitor>
);

In other words, make it an add-on to any existing monitor instead of maintaining a fork.

DockMonitor should give you an idea of how to implement composable monitor.
What you'd need to do is to pass filtered props to whatever monitor is inside.

Though we have to traverse the actions array twice (once in the FilterMonitor and the second one in the LogMonitor), I like the idea of composable monitors. It would also help us to support different monitors in the chrome extension.

Implemented. Also, the repository was renamed to redux-devtools-filter-actions, and instead of filter parameter we use whitelist and blacklist parameters now.

Thanks, @gaearon, for the suggestion!