Last active
February 8, 2017 06:55
-
-
Save kievechua/42f7f4d4aaa2e409f701 to your computer and use it in GitHub Desktop.
ES6 Reverse Module - ES6 Module is a little hard to scan, can we put module in front instead?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Just create out of frustration, it's hard for me to scan through the line to add an item. | |
For example I want to add react-bootstrap component "Alert". | |
It's easier to use the proposed version to scan through and add in. | |
Also it can be sorted, if not multi line. | |
Might need to some thinking on the syntax. */ | |
// Current | |
import { Breadcrumb } from 'components'; | |
import connectData from 'helpers/connectData'; | |
import { | |
FormControls, Input, | |
Breadcrumb, alert | |
} from 'react-bootstrap'; | |
import DocumentMeta from 'react-document-meta'; | |
import { connect } from 'react-redux'; | |
import React, { Component, PropTypes } from 'react'; | |
import { initializeWithKey} from 'redux-form'; | |
import { isLoaded, load as loadUser } from 'redux/modules/auth'; | |
import * as userActions from 'redux/modules/auth'; | |
// Proposed | |
from 'components' import { Breadcrumb }; | |
from 'helpers/connectData' import connectData; | |
from 'react-bootstrap' import { | |
FormControls, Input, | |
Breadcrumb, alert | |
}; | |
from 'react-document-meta' import DocumentMeta; | |
from 'react-redux' import { connect }; | |
from 'react' import React, { Component, PropTypes }; | |
from 'redux-form' import { initializeWithKey}; | |
from 'redux/modules/auth' import { isLoaded, load as loadUser }; | |
from 'redux/modules/auth' import * as userActions; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I feel the same pain. You are the first person I see writes about it.
I really like the "elm" notation which makes a lot of sense, Here's an example with a theoretical Math module:
Or
This way I get autocomplete for the packages I want to import, helps tons.
I wonder where it stands in the JS community.