<commit_before>var h = require('hyperscript')
var pull = require('pull-stream')
var u = require('./util')

exports.createStream = function createStream (stream, render) {
  var div = h('div.content')

  pull(
    stream,
    pull.drain(function (data) {
      var el = render(data)
      if('string' === typeof el) el = document.createTextNode(el)
      if(el) {
        if(div.children.length)
          div.appendChild(h('hr'))
        div.appendChild(el)
      }

    })
  )

  return div
}

exports.createRenderers = function (renderers, sbot) {
  return function (data) {
    return u.first(renderers, function (fn) {
      return fn(data, sbot)
    })
  }
}<commit_msg>use pull-scroll to get infinite scrolling<commit_after>var h = require('hyperscript')
var pull = require('pull-stream')
var u = require('./util')
var Scroller = require('pull-scroll')

exports.createStream = function createStream (stream, render) {
  var div = h('div.column', {style: {'overflow-y': 'auto'}})

  pull(
    stream,
    Scroller(div, div, render, false, false)
  )

  return div
}

exports.createRenderers = function (renderers, sbot) {
  return function (data) {
    return u.first(renderers, function (fn) {
      return fn(data, sbot)
    })
  }
}

{'fraction_non_alphanumeric': 0.14665592264302982, 'fraction_numerical': 0.0, 'mean_word_length': 3.2534246575342465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1380593', 'n_tokens_mistral': 411, 'n_tokens_neox': 403, 'n_words': 100}