@flowtype How to define a type of return of a fn based on an argument string? Asked twice on SO - Thanks stackoverflow.com/questions/β¦ #flowtype
Aug 25, 2017 Β· 1:53 PM UTC
The intersection approach is a good one. You could also use $ElementType with a utility map type: flow.org/try/#0CYUwxgNghgTiAβ¦
4
1
Also is there any utility that extracts the return of a function? const a = ():number => 6; $returnOf<a> would then be number.
1
1


