'use strict'
var Base = require('vigour-js/lib/base')
var reference = require('./reference')
var single = require('./single')
var collection = require('./collection')

exports.define = {
  subscriptionWalker: function subscriptionWalker (key, hub, map, event, result, client, top) {
    // check for reference! select obs and set correct result
    if (key) {
      if (this._input instanceof Base) {
        console.log('reference')
        reference.call(this, key, hub, map, event, result, client, top)
        return
      } else {
        // double check!
        result = result[key] = {}
      }
    }

    console.log('yo bitch!', key, map)

    for (let key in map) {
      if (key === '*') {
        collection.call(this, key, hub, map[key], event, result, client, top)
      } else if (key === 'val') {
        console.log('do it!')
        single.call(this, key, hub, map[key], event, result, client, top)
      } else {
        console.log('wrong???', key)
        // this can be out of scope maybe for now just put it all in scope?
        this.get(key, {})
          .subscriptionWalker(key, hub, map[key], event, result, client, top)
      }
    }
  }
}

@@ -398,41 +398,8 @@
 ) %7B%0A
-        console.log('reference')%0A
     
@@ -462,24 +462,24 @@
 lient, top)%0A
+
         retu
@@ -574,48 +574,8 @@
  %7D%0A%0A
-    console.log('yo bitch!', key, map)%0A%0A
     
@@ -738,38 +738,8 @@
 ) %7B%0A
-        console.log('do it!')%0A
     
@@ -835,112 +835,108 @@
     
-console.log('wrong???', key)%0A        // this can be out of scope maybe for now just put it all in scope?
+// bit weird should just subscribe i geuss%0A        // totally not nessecary if stuff does not exists
 %0A   
@@ -1054,10 +1054,97 @@
   %7D%0A  %7D%0A
-
 %7D%0A
+%0A// this.get(key, %7B%7D) this can be out of scope maybe for now just put it all in scope?%0A

remove logs