@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
1
1
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.

Aug 25, 2017 Β· 5:27 PM UTC

There are ways to do this with generic types and *. I want to add a $Call type which works like $ObjMap which would also let you do this.
1