0.1.40 clear console.logs

master
David Kebler 2020-01-18 22:29:35 -08:00
parent 80286a2e4f
commit ddd7556c3f
3 changed files with 9 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@uci/base",
"version": "0.1.39",
"version": "0.1.40",
"description": "Multi type and transport JSON packet communication base class. Used in UCI extended classes",
"main": "src/base",
"scripts": {

View File

@ -120,8 +120,6 @@ class Base extends EventEmitter {
*/
async init(sockets) {
// subscribe to all combination and send
this.ready.subscribe(async ready => {
this._readyPacket.ready= ready
delete (this._readyPacket.failure)
@ -129,6 +127,7 @@ class Base extends EventEmitter {
const name = this.ready.failure
this._readyPacket.failure = {name:name, details:this.ready.getObserverDetails(name)}
}
// console.log('base process ready - pushing/sending\n',this._readyPacket)
await this.send(this._readyPacket)
await this.push(this._readyPacket)
})
@ -257,8 +256,7 @@ class Base extends EventEmitter {
})
})
if (type==='c') {
this.ready.addObserver(`${name}:consumer`,this._socket[name],{event:'connection:socket',condition:ev=>{return ev.state==='connected'}})
this.ready.addObserver(`${name}:consumer`,this._socket[name],{event:'connection:socket',condition:ev=>ev.state==='connected'})
this._socket[name].on('pushed', packet => {
packet._header.socketName=name
this.emit('pushed', packet)

View File

@ -75,7 +75,9 @@ const defaultCmds ={
return packet
},
ready: async function (packet) {
console.log('======================== READY RECEIVED AND EMITTED (sent)==================================\n',packet)
// console.log('======================== READY RECEIVED AND EMITTED (sent)==================================')
// console.log(packet.event, 'ready', packet.ready)
// console.dir(packet)
const event = [ packet.event || packet.name || packet.id]
delete(packet._header)
this.emit(event,packet)
@ -92,7 +94,9 @@ const defaultCmds ={
return packet
},
ready: async function (packet) {
console.log('----------------------- READY RECEIVED AND EMITTED (pushed)---------------------------\n',packet)
// console.log('----------------------- READY RECEIVED AND EMITTED (pushed)---------------------------')
// console.log(packet.event, 'ready', packet.ready)
// console.dir(packet)
const event = [ packet.event || packet.name || packet.id]
delete(packet._header)
this.emit(event,packet)