You've Got a Type in Me π
Added
- "Extract Type" can now extract type literals. This is particularly handy when you have such a union type:
type Context =
| { state: "reading"; value: string }
| {
state: "editing";
value: string;
draftValue: string;
};
Put your cursor wherever within { state: "reading"; value: string }
, hit Ctrl+Shift+V (β β§ V) and there you have it:
type ReadingContext = { state: "reading"; value: string };
type Context =
| ReadingContext
| {
state: "editing";
value: string;
draftValue: string;
};
The ReadingContext
name was inferred, it it can be. In any case, you are in "rename mode" right away so you can type whatever is better, press Enter, be done.
In action: