Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

aleqsio
Copy link
Contributor

@aleqsio aleqsio commented May 17, 2024

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

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label May 17, 2024
@expo-bot
Copy link
Collaborator

expo-bot commented May 17, 2024

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 🤖

@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels May 18, 2024
Copy link
Member

@tsapeta tsapeta left a 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', () => {

@aleqsio aleqsio force-pushed the @aleqsio/add-stop-start-observing-web branch from c74521c to 6cd3e2b Compare May 21, 2024 14:18
@expo-bot
Copy link
Collaborator

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) 👇

⚠️ Suggestion: Missing changelog entries


Your changes should be noted in the changelog. Read Updating Changelogs guide and consider adding an appropriate entry to the following changelogs:


Generated by ExpoBot 🤖 against 7a7152c

@expo-bot expo-bot added bot: suggestions ExpoBot has some suggestions and removed bot: passed checks ExpoBot has nothing to complain about labels May 22, 2024
@aleqsio
Copy link
Contributor Author

aleqsio commented May 22, 2024

@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.

@aleqsio aleqsio requested a review from tsapeta May 28, 2024 13:44
}

listenerCount<EventName extends keyof TEventsMap>(eventName: EventName): number {
return this.listeners?.get(eventName)?.size ?? 0;
}

startObserving<EventName extends keyof TEventsMap>(eventName: EventName): void {}
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants