I'm using the bot.navigate.on('arrived', sleepInBed) to head to bed and then when arrived sleep. The thing is, it's causing a memory leak since the event listeners are stacking up. Now I have a bit to remove the event listener but it doesn't seem to work:
Hi,
I'm using the bot.navigate.on('arrived', sleepInBed) to head to bed and then when arrived sleep. The thing is, it's causing a memory leak since the event listeners are stacking up. Now I have a bit to remove the event listener but it doesn't seem to work:
bot.navigate.removeListener('arrived', sleepInBed)
Am I missing something? Is there a solution to having the .on('arrived') for a single time use?