In the React project I found this piece of code, which is pretty much standard:
import React from 'react';
import {
ImageLeft,
ImageRight,
ImageBottom,
ImageBanner
} from './content';
const LAYOUT_COMPONENT = {
image_left: ImageLeft,
image_right: ImageRight,
image_bottom: ImageBottom,
image_banner: ImageBanner
};
LAYOUT_COMPONENT object has repetitions. Is it possible somehow to create it with destructuring from import statement, in order to avoid extra code?