techniq / node-pn532

Native Node.js driver for the PN532 NFC chip
70 stars 31 forks source link

fix: prevent multiple tag polling loops #19

Closed jonathonlui closed 2 years ago

jonathonlui commented 4 years ago

Fix issue when multiple listeners are added for the tag event. When this happens multiple scanTag loops are running and cause scanTag to stop returning tags.

With this PR the scanTag loop only start on the first listener and stops after there are no more listeners.