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
I don’t think that should error. Will check.
1 reply 0 retweets 0 likes -
Replying to @naman34 @rickhanlonii
It will not error in Flow, but it will throw a runtime error.
1 reply 0 retweets 1 like -
Replying to @naman34 @rickhanlonii
Expected behaviour sadly
12:51 PM - 5 Apr 2019
0 replies
0 retweets
1 like
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 










