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 explain me what does the +
symbol mean in front of the property in the code below:
export type User = { +name: string, +surname: string, +personId: PourceId, }
I could not find any reference in the documentation, any link is also welcome.
In programming language theory, flow-sensitive typing (also called flow typing or occurrence typing) is a type system where the type of an expression depends on its position in the control flow. In statically typed languages, a type of an expression is determined by the types of the sub-expressions that compose it.
User Interface Flows are system models the show how different pages of a user interface are connected and how a user can step through various pages of the system. User Interface Flows are typically comprised of screens and navigation paths between various screens.
String Flow Viola samples a technique string players use, in which they quickly roll the bow across the strings to create an energetic, chordal texture. There are 2 ways to play the instrument. The first way is simple: just choose what type of chord you want, what key to be in, and then play on the white keys.
Both Flow and TypeScript provide the ability to explicitly cast a variable from one type to another. With Flow, we cast using the symbol : , while in TypeScript we cast using the keyword as . // TypeScript let value = 1 as number; // Flow let value = 1; (value: number);
The +
symbol in front of the property means the property is read-only
Reference: https://flow.org/en/docs/types/interfaces/#toc-interface-property-variance-read-only-and-write-only
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With