top | item 35589959 (no title) ekvintroj | 2 years ago Try to type a flatMap and then we talk. discuss order hn newest anamexis|2 years ago type ValueOrArray<T> = T | Array<ValueOrArray<T>>; type FlatMap<In, Out> = (array: Array<In>, fn: (el: In) => ValueOrArray<Out>) => Array<Out>; ekvintroj|2 years ago This does not work, that's the issue, try to run it. load replies (1) unknown|2 years ago [deleted] klysm|2 years ago Is this actually an issue?
anamexis|2 years ago type ValueOrArray<T> = T | Array<ValueOrArray<T>>; type FlatMap<In, Out> = (array: Array<In>, fn: (el: In) => ValueOrArray<Out>) => Array<Out>; ekvintroj|2 years ago This does not work, that's the issue, try to run it. load replies (1)
anamexis|2 years ago
ekvintroj|2 years ago
unknown|2 years ago
[deleted]
klysm|2 years ago