Open reggi opened 5 years ago
Cool library! I've been hunting / trying to make a good compositional library with typescript support.
In my initial test here:
import { compose } from '@arrows/composition' const addPrefixes = compose( (text: string) => `prefix1-${text}`, (text: string) => 3, (text: string) => `prefix2-${text}`, ) addPrefixes('arrows') // -> "prefix1-prefix2-arrows"
Here are some thoughts on how to improve typing:
addPrefixes
string
compose
3
Thank you, I will look into that.
@caderek "better late than never"
if this changes ok - i can fix pipe function next
Cool library! I've been hunting / trying to make a good compositional library with typescript support.
In my initial test here:
Here are some thoughts on how to improve typing:
addPrefixes
should bestring
, because it's the parameter of the first function incompose
.3
and the 4th which takes astring
and that shouldn't be allowed.