I have spread-and-copy code where I am extracting a type from a super set. With the attribute list growing up, is there a more elegant way of doing this?
const { name, handler, targetGrid, type } = event; //eg: event here is of type any
let e: Event = { name, handler, targetGrid, type } as Event;
Complete code: StackBlitz
The closest i could see is a solution here SO. But that would still merge my 2 lines to a single line, and eventually when the params grows big, lint would ask me to break the lines....
Am looking for a solution where I wouldn't have to repeat the attribute names twice.