What are the ellipsis called in the following Flow code and what do they do?
export type ListTypeNode = {
+kind: 'ListType',
+loc?: Location,
+type: TypeNode,
...
};
Run Code Online (Sandbox Code Playgroud)
小智 5
这是Flow中的新语法,将来将指示该对象类型不精确(默认情况下,常规注释将是精确的对象注释)。
In a few releases, Flow will begin to treat {foo: number} as an exact object. To indicate inexactness, you must add an ellipsis to the end of an object type: {foo: number, ...}. This new syntax forces the developers to opt into inexactness.
See more details here: https://medium.com/flow-type/on-the-roadmap-exact-objects-by-default-16b72933c5cf