Code Monkey home page Code Monkey logo

module's People

Contributors

jrburke avatar kidkarolis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

module's Issues

how to account for asynchronous exports?

The main weakness in using return at the bottom of a definition to declare the exports is that this is synchronous. If your module needs to do asynchronous work in order to initialise itself, you inevitably end up having to expose that asynchronous nature to other modules that depend on it (by exporting callbacks or promises).

I think return is still great syntax for wholly-synchronous modules.

One example of an asynchronous module is a module that always needs to perform an XMLHttpRequest during its initialisation, where it is highly convenient for all other client modules to be wholly-synchronous (no desire for asynchronous-ness to spread like a virus through the rest of the modules).

Should we consider these out of scope for the module system? If there are, indeed, within the scope, how do we asynchronously declare the exports of a module at a later time?

As Promise is now part of ES6, could we just return the Promise and have the module system automatically wait for its resolution prior to sharing the exports with other modules?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.