You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could you write up a bit longer explanation of how you'd want this to work? For example, if the declaration of map was instead map<T>(x: T, mapping: (...args: Args) => T, y: T): EventSource<[T]>;, what would the result be?
This sounds a lot like #4130. I have a proposal up at #5296, but I think it's currently too narrow for your use. I am definitely interested in seeing a good real-world explanations of how you (and others) would like it to work.
Ryan Cavanaugh (@RyanCavanaugh), I suppose you meant this signature: mapping: (...args: Args, y: T) => T. If es6 doesn't allow named args after ...args, then tsc can do the same.
Activity
RyanCavanaugh commentedon Oct 19, 2015
Could you write up a bit longer explanation of how you'd want this to work? For example, if the declaration of
mapwas insteadmap<T>(x: T, mapping: (...args: Args) => T, y: T): EventSource<[T]>;, what would the result be?sandersn commentedon Oct 19, 2015
This sounds a lot like #4130. I have a proposal up at #5296, but I think it's currently too narrow for your use. I am definitely interested in seeing a good real-world explanations of how you (and others) would like it to work.
d180cf commentedon Oct 20, 2015
Ryan Cavanaugh (@RyanCavanaugh), I suppose you meant this signature:
mapping: (...args: Args, y: T) => T. If es6 doesn't allow named args after...args, then tsc can do the same.eggers commentedon Aug 24, 2017
Another use case for this is to properly declare the spread function. Something like this: