Skip to content

Commit

Permalink
remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim de Beer committed Jan 13, 2017
1 parent 8d15bf4 commit ad7f3a4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 41 deletions.
1 change: 0 additions & 1 deletion lib/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const connect = (hub, url, reconnect) => {

socket.onmessage = ({ data }) => {
const stamp = bs.create('upstream')
if (hub.id === 'hybrid') console.log('\n\n\n\n', hub.id, '🤓 incoming:', JSON.stringify(JSON.parse(data), false, 2))
hub.set(JSON.parse(data), stamp)
bs.close(stamp)
}
Expand Down
15 changes: 1 addition & 14 deletions lib/server/incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,10 @@ export default (hub, socket, data) => {
if (payload) {
if (meta && meta.resolve) {
client.resolve = meta.resolve
if (hub.id === 'scraper') console.log('\n\n', hub.id, '1👻 incoming:', JSON.stringify(payload, false, 2))
console.log(t.tStamp)
t.set(payload, false)
console.log(t.tStamp)
bs.on(() => { client.resolve = false })
} else {
if (hub.id === 'scraper') {
console.log('\n\n', hub.id, '2👻 incoming:', JSON.stringify(payload, false, 2))
console.log(hub.subscriptions.map(val => val.id))
}
console.log(t.tStamp)
// delete t.tStamp
t.set(payload, false)
console.log(t.tStamp)
}
bs.close()
}
Expand All @@ -61,10 +51,7 @@ const create = (hub, socket, meta) => {
}

const incomingSubscriptions = (hub, client, meta, id) => {
const update = (t, type, subs, tree) => {
// console.log('🐲 ', hub.id, client.key)
send(hub, client, t, type, subs, tree)
}
const update = (t, type, subs, tree) => send(hub, client, t, type, subs, tree)
if (!client.upstreamSubscriptions) client.upstreamSubscriptions = {}
for (let key in meta.subscriptions) {
let uid = key + '-' + id
Expand Down
22 changes: 2 additions & 20 deletions test/context.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
const hub = require('../')
// const test = require('tape')

const test = (label, fn) => {
var cnt = 0
var x = {
pass: (val) => console.log(val),
end: () => {
cnt++
console.log('\n\n\n\n-----------------------------\ncompleted cycle --- next!', cnt)
setTimeout(() => fn(x), 100)
}
}
fn(x)
}
const test = require('tape')

test('context', t => {
const scraper = hub({
Expand Down Expand Up @@ -70,8 +57,6 @@ test('context', t => {
client2.get('somefield', {}).once('hahaha')
]).then(() => {
t.pass('client1 & client2 receive context updates')
// console.log(hybrid.getContext('pavel').keys())
console.log('\n\n\n🐼 🐤 🐼')
client4.set({ smurf: true })
})

Expand All @@ -90,10 +75,7 @@ test('context', t => {
client3.get('blurf', {}).once('hello').then(() => {
t.pass('client3 receives updates after switching context')
client1.set({ context: false })
hybrid.getContext('pavel').clients.once(t => {
console.log('??????', t.keys())
return t.keys().length === 2
})
hybrid.getContext('pavel').clients.once(t => t.keys().length === 2)
.then(() => {
t.pass('removed client from hybrid')
client1.set(null)
Expand Down
1 change: 0 additions & 1 deletion test/data-size.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ test('data size', { timeout: 2000 }, t => {
server.set({ someData })

client.subscribe({ someData: true }, () => {
console.log('fire')
t.ok(true, 'subscription fired')
t.end()
})
Expand Down
10 changes: 5 additions & 5 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
if (typeof window === 'undefined') {
require('source-map-support').install()
}
// require('./connect')
// require('./multiple')
// require('./data-size')
// require('./switch')
require('./connect')
require('./multiple')
require('./data-size')
require('./switch')
require('./context')
// require('./types')
require('./types')

0 comments on commit ad7f3a4

Please sign in to comment.