<commit_before>(function () {
  function VueRx (Vue) {
    var VueVersion = Number(Vue.version && Vue.version.split('.')[0])
    var initHook = VueVersion && VueVersion > 1 ? 'beforeCreate' : 'init'

    var mixin = {
      beforeDestroy: function () {
        if (this._rxHandles) {
          this._rxHandles.forEach(function (handle) {
            handle.dispose()
          })
        }
      }
    }

    mixin[initHook] = function init () {
      var self = this
      var dataFn = this.$options.data
      if (dataFn) {
        this.$options.data = function () {
          var raw = dataFn()
          Object.keys(raw).forEach(function (key) {
            var val = raw[key]
            if (val.subscribe instanceof Function) {
              raw[key] = null
              ;(self._rxHandles || (self._rxHandles = []))
                .push(val.subscribe(function (value) {
                  self[key] = raw[key] = value
                }))
            }
          })
          return raw
        }
      }
    }

    Vue.mixin(mixin)
  }

  // auto install
  if (typeof Vue !== 'undefined') {
    Vue.use(VueRx)
  }

  if(typeof exports === 'object' && typeof module === 'object') {
    module.exports = VueRx
  } else if(typeof define === 'function' && define.amd) {
    define(function () { return VueRx })
  } else if (typeof window !== 'undefined') {
    window.VueRx = VueRx
  }
})()
<commit_msg>Fixes error thrown if data's initial value is null (#8)<commit_after>(function () {
  function VueRx (Vue) {
    var VueVersion = Number(Vue.version && Vue.version.split('.')[0])
    var initHook = VueVersion && VueVersion > 1 ? 'beforeCreate' : 'init'

    var mixin = {
      beforeDestroy: function () {
        if (this._rxHandles) {
          this._rxHandles.forEach(function (handle) {
            handle.dispose()
          })
        }
      }
    }

    mixin[initHook] = function init () {
      var self = this
      var dataFn = this.$options.data
      if (dataFn) {
        this.$options.data = function () {
          var raw = dataFn()
          Object.keys(raw).forEach(function (key) {
            var val = raw[key]
            if (val && val.subscribe instanceof Function) {
              raw[key] = null
              ;(self._rxHandles || (self._rxHandles = []))
                .push(val.subscribe(function (value) {
                  self[key] = raw[key] = value
                }))
            }
          })
          return raw
        }
      }
    }

    Vue.mixin(mixin)
  }

  // auto install
  if (typeof Vue !== 'undefined') {
    Vue.use(VueRx)
  }

  if(typeof exports === 'object' && typeof module === 'object') {
    module.exports = VueRx
  } else if(typeof define === 'function' && define.amd) {
    define(function () { return VueRx })
  } else if (typeof window !== 'undefined') {
    window.VueRx = VueRx
  }
})()

{'fraction_non_alphanumeric': 0.1447046487242223, 'fraction_numerical': 0.0017476406850751485, 'mean_word_length': 1.7894736842105263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3155875', 'n_tokens_mistral': 902, 'n_tokens_neox': 878, 'n_words': 192}