all files / components/ Base.js

100% Statements 11/11
100% Branches 2/2
100% Functions 3/3
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17                       
import React, { Component } from 'react';
 
export default class Base extends Component {
  constructor(props) {
    super(props);
 
    this.el = React.Children.only(props.children);
    this.handlersToWrap = props.handler.length ? [props.handler] : props.handlers;
  }
 
  componentWillUnmount() {
    this._throttler.destroy();
  }
 
  render = () => this._throttler.element();
}