Import wildcards on the right side of the statement

Francisco Méndez Vilas fmvilas at gmail.com
Thu Apr 21 09:36:51 UTC 2016


Hi all,

This is my very first proposal here, so please let me know if i'm not
following some rules.

I want to make a proposal around the "import" syntax, it is, for instance:

import * from 'shared/features/**/reducers';

or

import * from many 'shared/features/**/reducers';

This came to my mind when developing an isomorphic Redux application where
i had to import all reducers of each feature. My tree structure looks more
or less like that:

+ shared
  + features
     + todos
       + actions
       + components
       + reducers
         - TodoReducer.js
         - index.js
     + users
       + actions
       + components
       + reducers
         - UserReducer.js
         - index.js

If i have to import every "index.js" below each "reducers" directory, i
have two options, either manually import each of them or prepare a script
to walk through the tree and import them. Both of the approaches are really
weird.

I really would like to have that feature in the language. What do you think?

Cheers,
Francisco Méndez Vilas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160421/b4dedb31/attachment.html>


More information about the es-discuss mailing list