This is just the definition. It takes a nullable type and gives you a non-nullable type. used it for Array<?T>.filter(Boolean)
I'm very interested in the concrete thing you're trying to express. I'll be the first to admit deficiencies in TS.
-
-
maybe it's a little academic. All I'm trying to express is an overloaded type for the Array filter method.
-
so while normally .filter will return the same array type as the input. If the function is the Boolean class it removes the nulla
-
-
looks good. But I think the second filter should return Option<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)
- 7 more replies
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.