Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use event emitters to dispatch incoming gateway events (#14)
* Migrate READY handling to a separate file In preparation for moving all high-level gateway event handling to a separate location, move the code handling the READY event into a separate file. Ultimately, I'm not too sure that converting class methods into exported free functions is the best idea, especially since they take an instance of the class and mutate it to boot---but the class itself was getting pretty long and it made the file a bit difficult to navigate. * Listen for gateway events via EventEmitter Naively move all code handling gateway events into subscriber functions that attach to an EventEmitter for better organization. Better types are pending. * Merge gateway event handling into a single file Less tab juggling in the text editor, while remaining easier to navigate. Less import churn too. * report gateway event handler errors to sentry Co-authored-by: Kishan Bagaria <[email protected]> --------- Co-authored-by: Kishan Bagaria <[email protected]>
- Loading branch information