-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
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:
- The parameter type of
addPrefixesshould bestring, because it's the parameter of the first function incompose. - You can see above I have the 2nd function which returns
3and the 4th which takes astringand that shouldn't be allowed.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers