Logan Smyth (2016-08-12T00:44:13.000Z)
Actively thinking about "live bindings" may honestly confuse the way you
think about imports. When you do

    export var foo = "value";

then

    import {foo} from "./foo";
    console.log(foo);

Every time you access `foo` in the second module, you are literally
reaching into the first module to grab the current value of `foo`. You can
think of it like this, in CommonJS terms:

    var foo = "value";

    Object.defineProperty(exports, 'foo', { get(){ return foo; } }

and

    var fooMod = require('./foo');
    console.log(fooMod.foo);

so accessing the 'foo' export calls a getter method to access the current
value of `foo`, so any change to the value inside the first module will
immediately change the next time you trigger the getter.

On Thu, Aug 11, 2016 at 5:35 PM, /#!/JoePea <joe at trusktr.io> wrote:

> Are bindings live across all modules at the same time, as if the
> identifier were defined in an outer scope common to all the modules that
> import it?
>
> */#!/*JoePea
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160811/61fab17a/attachment.html>
forbes at lindesay.co.uk (2016-08-25T10:39:39.377Z)
Actively thinking about "live bindings" may honestly confuse the way you
think about imports. When you do

```js
export var foo = "value";
```

then

```js
import {foo} from "./foo";
console.log(foo);
```

Every time you access `foo` in the second module, you are literally
reaching into the first module to grab the current value of `foo`. You can
think of it like this, in CommonJS terms:

```js
var foo = "value";

Object.defineProperty(exports, 'foo', { get(){ return foo; } }
```

and

```js
var fooMod = require('./foo');
console.log(fooMod.foo);
```

so accessing the 'foo' export calls a getter method to access the current
value of `foo`, so any change to the value inside the first module will
immediately change the next time you trigger the getter.