Combine-Object-Destructuring¶
Sourcery rule id: combine-object-destructuring
¶
Description¶
Combine destructure assignments.
Before¶
const {firstName} = user;
const {lastName} = user;
After¶
const {firstName, lastName} = user;
Explanation¶
Object destructuring can often remove an unnecessary temporary reference, as well as making your code more succinct.
From the Airbnb Javascript Style Guide