Created
January 12, 2018 10:37
-
-
Save sanohin/99d73b86ddf1a8a09005964b334ee4d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const SomeMap = { | |
| fn1: ({ a }: { a: number }) => ({ a, b: 1 }), | |
| fn2: ({ c }: { c: string }) => ({ c, d: 1 }) | |
| }; | |
| const someFunction = someFns => params => { | |
| const someValue = someFns.reduce((acc, cur) => { | |
| acc.push(cur(params)); | |
| return acc; | |
| }, []); | |
| }; | |
| someFunction([SomeMap.fn1, SomeMap.fn2])({ a: 2, c: 4 }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment