-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Remove event target shim. (#545)
Unlike the EventEmitter in the node SDK the EventTarget was not providing an interface directly on the LDClient. The LDClient has its own off/on interface which is not directly implemented via an event target. Which means removing it simplifies the implementation instead of complicating it. Second it is in the common code and node in a leaf implementation. Which means it requires a polyfill where it is not supported. Like when using hermes with React Native. Typically we dispatch using a micro-task, but EventTarget dispatches synchronously. For now this maintains the synchronous behavior. Fixes: #412
- Loading branch information
1 parent
c04a9fd
commit 448ad67
Showing
6 changed files
with
43 additions
and
90 deletions.
There are no files selected for viewing
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,4 @@ | ||
import EventTarget from 'event-target-shim'; | ||
|
||
import { type Hasher, sha256 } from '../fromExternal/js-sha256'; | ||
import { base64FromByteArray, btoa } from './btoa'; | ||
import CustomEvent from './CustomEvent'; | ||
|
||
function setupPolyfill() { | ||
Object.assign(global, { | ||
EventTarget, | ||
CustomEvent, | ||
}); | ||
} | ||
export { base64FromByteArray, btoa, type Hasher, setupPolyfill, sha256 }; | ||
export { base64FromByteArray, btoa, type Hasher, sha256 }; |
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