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

Simplifying the type signature of useResolved #34

Open
FlatMapIO opened this issue Jan 14, 2024 · 0 comments
Open

Simplifying the type signature of useResolved #34

FlatMapIO opened this issue Jan 14, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@FlatMapIO
Copy link

I tested the following type signature, and it correctly inferred the list of variable parameter types, so maybe we can use it to simplify the signature of the useResolved function.

function resolve<
  T extends unknown[],
  R extends {
    [K in keyof T]: T[K] extends Observable<infer V> ? V : T[K] extends () => infer V ? V :  T[K]
  },
>(vals: [...T], fn: (...args: [...R]) => void) {


}

resolve([$(1), $('2'), 3, () => 4], (_1, _2,_3, _4) => {

})
image
@fabiospampinato fabiospampinato added the enhancement New feature or request label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants