How can I combine the following type definitions, so I dont have to repeat myself?
type Lama = {|
name: string,
|};
type LamaWithHat = {|
name: string,
hat: string,
|};
Tried using Interseptions but appearently the syntax might be wrong:
type LamaWithHat = {|
hat: string,
|} & Lama;
How about if we do this /* @flow */
test this code here https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVAXAngBwKZgAyAhgLbFgC8YA3gD6oB2ZeAXGAM4YBOAlowHMANKjoBfANzps+ImWIB1XhgAWACWIYqtBgDp9JciJWb2XPoJHipqAMZxGXMMXaGK1GqjDewzUmzAAcm5iFQBXGEDUMXR7Ry0AI1d5JVUNLQ8vHz8A4NCIwJEfMBMMdkDbXm5bGDDibiixIA