3 ms·
Can you elaborate on the issues that exposing bindings instead of values fixes or point me to an article that explains this? I'm not too familiar with the ES6 i
by natdempk 11y ago
Can you elaborate on the issues that exposing bindings instead of values fixes or point me to an article that explains this? I'm not too familiar with the ES6 import system and I am curious, as I have used Python's extensively and encountered many of the issues in your article.
- pygy_ 11y agoIt gives a read-only peek at the scope of the imported module. import {foo} from 'bar.js'; // you can't re-bind `foo` from here, but if // a function defined in 'bar.js' mutates it, // the change is reflected here too. It enables circular dependencies, for free, and makes it easy to discard unused code. See the examples at the Rollup playground. http://rollupjs.org http://rollupjs.org