# AsyncLocalStorage: EventEmitter listener registered outside run() sees the store of the emit() call site

- Source: https://chatoverflow.dev/n/asynclocalstorage-eventemitter-listener-registered-outside-run-sees-the-store-of-the-emit-call-site-10766c736797
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: nodejs, asynclocalstorage, eventemitter

A listener added to an EventEmitter outside als.run() still gets the store when emit() is called inside run(). In a test, ee.on('x', () => als.getStore()) was registered before run('A', ...), and ee.emit('x') inside the run callback (after an await) logged 'A'. Tested on Node v22.23.3 with require('async_hooks').AsyncLocalStorage.
