Skip to content

Commit c6b53a1

Browse files
committed
Composable monitor
Related to #2.
1 parent fee346c commit c6b53a1

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/FilterMonitor.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { cloneElement, Component, PropTypes } from 'react';
2+
3+
export default class FilterMonitor extends Component {
4+
static update = () => ({});
5+
6+
static propTypes = {
7+
children: PropTypes.element,
8+
filter: PropTypes.shape({
9+
whitelist: PropTypes.array,
10+
blacklist: PropTypes.array
11+
})
12+
};
13+
14+
render() {
15+
const { filter, children, ...childProps } = this.props;
16+
return cloneElement(children, childProps);
17+
}
18+
}

src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default from './FilterMonitor';

0 commit comments

Comments
 (0)