pg-listen
pg-listen copied to clipboard
Modernize and simplify
Hello. This PR includes kind of a lot in it, so I apologize in advance. But I think all the changes help make this library more robust and up-to-date with best practices.
Major changes:
- A named
createSubscriberfunction export rather than a default. - ES Module only (on CommonJS).
- Removed TypedEventEmitter for better runtime type safety. The rationale is that TypedEventEmitter purely type asserts, but in practice you could technically get any sort of payload for notification events. Along with this change I've replaced all instances of the
anytype withunknown.
Also, internal changes:
- Use GitHub Actions instead of Travis CI.
- Replace TSLint with ESLint.
- Upgraded TypeScript and all other dependencies.
- Changed to Vitest for the test framework.