top | item 35589959

(no title)

ekvintroj | 2 years ago

Try to type a flatMap and then we talk.

discuss

order

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.

klysm|2 years ago

Is this actually an issue?