How to make emit when some variable changes?
I have a websockets server, in which i want to fire emit when there are n amount of users only ONCE. But for some reason it fires 2 times instead of 1. How would i get desired behavior?
1 Reply
why are you checking for usersCount to be > n shouldn’t you just usersCount === n?
then you would only emit once the room has n members