Equivalent of requiring a subproperty in ES6 import
I have an existing require : const {dialog} = require('electron').remote; I started using Babel for ES6, and would like to import this instead. So far I have: import electron from 'electron'; const {dialog} = electron.remote; This is ugly, and I can't help but feel there is a better way to do this. I just need the dialog here. How do I get at it in one line? ECMAScript module syntax doesn't allow deep destructuring. In fact it doesn't destructure at all. Import statements create live bindings between modules. Here is great blog post written by Ben Nadel. It should shed some light on bindings: