FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Need to fix Typescript definitions since Typescript 4.6 · Issue #2589 · knockout/knockout · GitHub

Need to fix Typescript definitions since Typescript 4.6 #2589

Description

Based on microsoft/TypeScript#48150 and https://stackoverflow.com/questions/71319489/type-observablefalse-is-not-assignable-to-type-observableboolean I report that in the Typescript 4.6 the type definitions are leading to compile errors. As stated, the definitions were not correct but the type system was fixed and now the error surfaced.
To be concrete, it will be necessary to make small changes all over the place like this:

FROM:

function observable<T>(value: T): Observable<T>
{
  return undefined as any;  // the implementation is not important
}

TO:

function observable<T, U = any>(value?: T extends infer R ? R : U): unknown extends T ? Observable<U> : Observable<T>
{
  return undefined as any;  // the implementation is not important
}

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


    Back | FazBrowse Home | New Git URL