-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[expo-modules-core] Add stopObserving and startObserving functions #28953
base: main
Are you sure you want to change the base?
Conversation
The Pull Request introduced fingerprint changes against the base commit: d34b738 Fingerprint diff[
{
"type": "dir",
"filePath": "../../packages/expo-modules-core",
"reasons": [
"expoAutolinkingIos",
"expoAutolinkingAndroid"
],
"hash": "4dc570f56132dec21b5fde6d9226f7b73aa8eb35"
}
] Generated by PR labeler 🤖 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to move these tests to https://github.com/expo/expo/blob/main/packages/expo-modules-core/src/__tests__/EventEmitter-test.web.ts
Also notice these silenced tests:
// TODO: Enable these tests once Web supports `startObserving` and `stopObserving`. | |
xdescribe('observing', () => { |
packages/expo-modules-core/src/__tests__/core-module/EventEmitter-test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
Co-authored-by: Łukasz Kosmaty <lukasz.kosmaty@swmansion.com>
c74521c
to
6cd3e2b
Compare
Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines. I've found some issues in your pull request that should be addressed (click on them for more details) 👇
|
@tsapeta I fixed a failing test case in sensors – think the current test is the expected behaviour, not sure why the expectation was different 5y ago. |
} | ||
|
||
listenerCount<EventName extends keyof TEventsMap>(eventName: EventName): number { | ||
return this.listeners?.get(eventName)?.size ?? 0; | ||
} | ||
|
||
startObserving<EventName extends keyof TEventsMap>(eventName: EventName): void {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could remove it and make it optional
Why
Matching iOS implementation for startObserving and stopObserving functions
How
Added calling those functions to CoreModule's EventEmitter class.
Test Plan
Added unit tests.
Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).