ESM exporting getters and setters.

Michael J. Ryan tracker1 at gmail.com
Thu Sep 20 23:21:16 UTC 2018


    // myFoo.mjs
    _hiddenFoo = false;
    export get foo() {
      return _hiddenFoo;
    }

    export set foo(value) {
      _hiddenFoo = !!value;
    }

    // main.mjs
    import {foo} from './myFoo.mjs';

Not sure if this has been discussed, but would be a nice feature to have in
some cases... I know, total side effects and mutations, all the same, would
be a nice to have in a few cases.

-- 
Michael J. Ryan
480-270-4509
https://www.tracker1.info/
me at tracker1.info
tracker1 at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180920/c1cee2ab/attachment.html>


More information about the es-discuss mailing list