class Array<T>{ filter(fn: typeof Boolean): Array<$NonNull<T>>; }
-
-
exactly the use-case I was going for! The next big project is to type immutable.js without losing any info.
-
$keys gives flow a bit of an edge. But neither flow or TS can fully type immutable.js right now. Another day! -
which aspect of immutable.js is un-typeable? (I've had fun times trying to type parts of Ember, so I know a few tricks :P)
-
1. .get should only take valid keys for a Record. (Possible with
$keys in flow) -
ah it produces an enum of the keys of a type?
-
there are a few secret magic types in flow that are the most awesome things for typing library code.
$keys gives you a string enum. -
-
yup!
- 2 more replies
New conversation -
-
-
btw I'm using the annotations to indicate what inference would have picked.
-
yup. Got that.
- End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.