-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use EvenEmitter3 for web-sdk (#847)
<!-- Please use this template for your pull request. --> <!-- Please use the sections that you need and delete other sections --> ## This PR <!-- add the description of the PR here --> Fixes an issue where the `events` node polyfill does not comply to the `node:events` types. When trying to use the web OpenFeatureEventEmitter the following error message comes up, describing that the `events` polyfill's EventEmitter is incompatible to `node:events` EventEmitter. ``` ✘ [ERROR] TS2416: Property 'eventEmitter' in type 'OpenFeatureEventEmitter' is not assignable to the same property in base type 'GenericEventEmitter<ProviderEmittableEvents, Record<string, unknown>>'. Type 'EventEmitter' is not assignable to type 'PlatformEventEmitter'. Types of property 'addListener' are incompatible. Type '(type: string | number, listener: Listener) => EventEmitter' is not assignable to type '(eventName: string | symbol, listener: (...args: any[]) => void) => PlatformEventEmitter'. Types of parameters 'type' and 'eventName' are incompatible. Type 'string | symbol' is not assignable to type 'string | number'. Type 'symbol' is not assignable to type 'string | number'. ``` This PR fixes that issue by not using the `events` anymore and instead using https://www.npmjs.com/package/eventemitter3 cc @toddbaert ### Related Issues <!-- add here the GitHub issue that this PR resolves if applicable --> Fixes #845 --------- Signed-off-by: Lukas Reining <[email protected]> Signed-off-by: Todd Baert <[email protected]> Co-authored-by: Todd Baert <[email protected]>
- Loading branch information
1 parent
1461074
commit 861cf83
Showing
4 changed files
with
27 additions
and
38 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters