When using Flow, be careful with empty objects. They are "unsealed" which means that all properties are effectively optional at the original call site. Meaning, this does NOT error: const obj: {foo: string} = {}; This behaviour is specific to an empty object.
-
-
Replying to @sebmck
So this will pass flow check but throw at runtime? type Foo = { baz: () => void } function callBaz(foo: Foo) { // baz exists because types return foo.baz() } const foo: Foo = {} callBaz(foo) > UNDEFINED IS NOT A FUNCTION
3 replies 1 retweet 7 likes -
-
Replying to @sebmck @rickhanlonii
this took a very long time to make, what am i doing with my life
10:57 PM - 4 Apr 2019
0 replies
0 retweets
17 likes
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.
he/him 










