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

Typescript: Bad function signature for .sample(). #537

Open
vlinder opened this issue May 14, 2020 · 0 comments
Open

Typescript: Bad function signature for .sample(). #537

vlinder opened this issue May 14, 2020 · 0 comments

Comments

@vlinder
Copy link

vlinder commented May 14, 2020

Summary

TypeScript typings for most does not support sending only one stream as an argument to sample(). (But most supports this.)

I also suggest we move to using mapped types instead, supporting arbitrary number of arguments for functions where supported by TypeScript.

I have made a PR implementing a simple change without mapped types to support this use case, #536.

Expected result

Not getting a type error

Actual Result

Getting a type error

image

Versions

  • Typescript 3.8.3
  • most.js: 1.8.0

Steps to reproduce

  1. Paste the code to reproduce into editor.
  2. See the error appear, expecting a second stream.

Code to reproduce

import { just } from "most";
just().sample((x) => x, just())
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