web3data-js icon indicating copy to clipboard operation
web3data-js copied to clipboard

Calling .on before connect does not error elegantly

Open taylorjdawson opened this issue 6 years ago • 0 comments

Bug:

Calling .on before connect does not error elegantly (and perhaps it should not error).It might be necessary that it saves the subscription then connects after the .connect() method is called.

Steps to replicate:

const w3d = new Web3Data(API_KEY)
w3d.on({eventName: 'block'}, () => {
})
w3d.connect()

This will throw an x is undef error.

taylorjdawson avatar Nov 27 '19 23:11 taylorjdawson