Open codingedgar opened 5 years ago
Hi! first, thank you all for this superb library!
I loooove transducers, so i'm usually using transducer or into everywhere i can, but in typescript land, it has been very hard for me to type it, i would like to understand both how could type it and if it is not possible where is the issue.
transducer
into
import { filter, into, map, compose, } from 'ramda'; type OrderAndValue = { order: number, value: string } type Values = string[] const vals: Values = into<any>( [], compose<any, any, any>( filter<any>(x => x.id > 5), map<any, any>(x => x.val) ), [ { order: 1, value: 'a' }, { order: 5, value: 'b' }, { order: 10, value: 'c' }, ] )
here, for typescript is so difficult to understand what gets into map, because transducer expects to apply the fns in compose in the read order.
map
compose
My question: is there any way to type this ? to get the type of OrderAndValue in the map and return Values ?
OrderAndValue
Values
Hi! first, thank you all for this superb library!
I loooove transducers, so i'm usually using
transducer
orinto
everywhere i can, but in typescript land, it has been very hard for me to type it, i would like to understand both how could type it and if it is not possible where is the issue.here, for typescript is so difficult to understand what gets into
map
, because transducer expects to apply the fns incompose
in the read order.My question: is there any way to type this ? to get the type of
OrderAndValue
in themap
and returnValues
?