Skip to content

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

Description

@vlinder

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions