Closed
Description
Currently, because of the leading |
symbol , the following code is invalid TypeScript:
type ReduxAction =
| { type: "INCREMENT" }
| { type: "DECREMENT" }
| { type: "SET_VALUE", value: number };
I suggest we relax the syntax such that a single leading pipe symbol is allowed (but not required) in a union type declaration. Flow and F#, for example, both allow this syntax.
This change is backwards-compatible and gives developers a little more code formatting freedom.