Flow type, What does the `+` symbol mean in front a property?

后端 未结 3 1303
离开以前
离开以前 2020-12-11 14:21

I came across the following code written in js FlowType (I am interested to know the value of + in the context of FlowType not in general JS).

Could you please expla

3条回答
  •  天命终不由人
    2020-12-11 15:15

    The '+' symbol means the property is read only and
    '-' means the property is write only and
    If does not have any '+' or '-' symbol it means the property have both read/write access.
    It can be used while defining interface property or type property.

    The documentation can be found in below link:
    https://flow.org/en/docs/types/interfaces/#toc-interface-property-variance-read-only-and-write-only

提交回复
热议问题