type someType = {
keyOne: string,
keyTwo: string,
};
type someOtherType = {
keyOne: string,
keyTwo: string,
keyThree: string,
};
Both of these types are objects that contain keyOne
and keyTwo
, the only difference is the latter extends the former with an additional key of keyThree
.
Rather than writing duplicated code, is it possible to build the someOtherType
flow type by extending someType
? In my mind, ES6 object rest/spread comes to mind, but I'm not sure how to accomplish something like this in Flow.
Thanks!