<commit_before>'use strict'
var Observable = require('vigour-js/lib/observable')
// var subscribe = Observable.prototype.subscribe
var Event = require('vigour-js/lib/event')
var Protocol = require('../../../protocol')

// function handleRemove (data, event, client, map) {
//   console.error('HAVE TO REMOVE HAVE TO RMEOVE!!!', JSON.stringify(map, false, 2))
// }

exports.define = {
  $ (map, attach, ready) {
    console.log('yo subscribe bitch!', this.path, map)
    if (attach) {
      // temp fix element needs to emit on remove !!!! else where fucked ofcourse...
      // attach.on('remove', [handleRemove, this, map])
    }
    // now what we need to do is just maybe handle refs differently when no scope :/
    var path
    var adapter = this.lookUp('adapter') // this.getAdapter()
    if (adapter) {
      adapter.each((protocol) => {
        if (protocol.client) {
          if (!path) {
            path = this.syncPath.join('.')
          }
          let ev = new Event('subscribe')
          let client = protocol.client.origin
          if (path === true || !path) {
            path = '$'
          }
          client.origin.send(this, client._parent._parent, { [path]: map }, ev, ready || true)
          ev.trigger()
        }
      }, (p) => p instanceof Protocol)
    }
  }
}
<commit_msg>fixes<commit_after>'use strict'
var Observable = require('vigour-js/lib/observable')
// var subscribe = Observable.prototype.subscribe
var Event = require('vigour-js/lib/event')
var Protocol = require('../../../protocol')
// function handleRemove (data, event, client, map) {
//   console.error('HAVE TO REMOVE HAVE TO RMEOVE!!!', JSON.stringify(map, false, 2))
// }
exports.define = {
  $ (map, attach, ready) {
    console.log('yo subscribe bitch!', this.path, map)
    if (attach) {
      // temp fix element needs to emit on remove !!!! else where fucked ofcourse...
      // attach.on('remove', [handleRemove, this, map])
    }
    // now what we need to do is just maybe handle refs differently when no scope :/
    var path
    var adapter = this.lookUp('adapter') // this.getAdapter()
    if (adapter) {
      adapter.each((protocol) => {
        if (protocol.client) {
          if (!path) {
            path = this.syncPath.join('.')
          }
          let ev = new Event('subscribe')
          let client = protocol.client.origin
          if (path === true || !path) {
            path = '$'
          }
          client.origin.send(this, client._parent._parent, { [path]: map }, ev, ready || true)
          ev.trigger()
        }
      }, (p) => p instanceof Protocol)
    }
  }
}

{'fraction_non_alphanumeric': 0.15732924021488873, 'fraction_numerical': 0.0007674597083653108, 'mean_word_length': 2.279245283018868, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1864528', 'n_tokens_mistral': 772, 'n_tokens_neox': 763, 'n_words': 220}