code: function InView (el, callback) {
      var _this = this
      if (!(_this instanceof InView)) {
        return new InView(el, callback)
      }
  
      _this.el = el
      _this.callback = callback.bind(_this)
      _this.destroy = function () {}
  
      if (!el) {
        return _this
      }
  
      var isDestroyed = false
  
      var check = function check (e) {
        if (isDestroyed) return false
  
        var params = {
          windowScrollTop: getScrollTop(),
          elementOffsetTop: _this.el.offsetTop,
          inViewHeight: window.innerHeight,
          elementOffsetTopInViewHeight: window.innerHeight - (getScrollTop() - (_this.el.offsetTop - window.innerHeight))
        }
        if (isInView(_this.el)) {
          addClass(_this.el, 'inview')
          _this.callback.call(_this, true, params)
        } else {
          removeClass(_this.el, 'inview')
          _this.callback.call(_this, false, params)
        }
      }
  
      var throttledCheck = throttle(check, 100)
  
      addEvent(window, 'scroll', throttledCheck)
  
      _this.destroy = function () {
        isDestroyed = true
        removeEvent(window, 'scroll', throttledCheck)
      }
  
      throttledCheck()
  
      return _this
    }
docs: @desc Create an InView instance.
  
  @class
  @func InView
  @param {HTMLElement} element - element to detect when scrolled to view
  @param {scrollCallback} scrollCallback - callback function fired on scroll event
  @return {HTMLElement} - element
  
  @example
  var el = document.querySelector('.item');
  
  var InView = InView(el, function(isInView, data) {
  if (isInView) {
  console.log('in view');
  } else {
  if (data.windowScrollTop - (data.elementOffsetTop - data.inViewHeight) > data.inViewHeight) {
  console.log('not in view (scroll up)');
  } else {
  console.log('not in view (scroll down)');
  }
  }
  });