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

Wrong type for getMessage(...).wait #19

Open
asjir opened this issue Apr 26, 2024 · 0 comments
Open

Wrong type for getMessage(...).wait #19

asjir opened this issue Apr 26, 2024 · 0 comments

Comments

@asjir
Copy link

asjir commented Apr 26, 2024

Google search terms

I only went through files here.

Describe the bug

getMessage(...).wait will return the same i.e. [data, sender] tuple, as does firstValueFrom(getMessage(...).stream)
but the types are annotated incorrectly

How do we reproduce?

const [_, stream, wait] = getMessage("a")
const waited = wait()
const streamed = firstValueFrom(stream)

Expected behavior

the same type

Actual behavior

the type infer to Promise and Promise<[string, chrome.runtime.MessageSender]> even though the output is the same

Screenshots

Please complete the following information:

  • Library Version: 1.2.2
  • Operating System: Mac
  • Browser: N/A (but Brave)
  • Node Version: v21.7.1

Additional context

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

No branches or pull requests

1 participant