PaulBernier / factomjs

Javascript library to build applications on the Factom blockchain.
MIT License
22 stars 7 forks source link

Add discardCurrent option to FactomEventEmitter #16

Closed OrmEmbaar closed 4 years ago

OrmEmbaar commented 4 years ago

The current behaviour of FactomEventEmitter is to emit the current highest block immediately when a new event emitter is attached. This can cause problems where the user is only concerned with new blocks arriving in the future.

This PR adds the boolean option discardCurrent to FactomEventEmitter to allow the user to ignore the current tip of the blockchain when the listener is attached. It does not change behaviour for existing users and is therefore backwards compatible.

OrmEmbaar commented 4 years ago

Closing this in favour of #17 which has been rebased.