Created
August 3, 2018 20:00
-
-
Save lagden/7ad486687fb2d0cbe24165b0a60ba9d5 to your computer and use it in GitHub Desktop.
ECMAScript Modules (import/export)
This file contains hidden or 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
| const a = 'a' | |
| export default a |
This file contains hidden or 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
| export const b = 'b' |
This file contains hidden or 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
| export {default as a} from './a' | |
| export {b} from './b' | |
| export {c as xxx, d as zzz} from './varios' |
This file contains hidden or 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
| import * as icons from './icons' | |
| const {a, b} = icons | |
| console.log(a, b) | |
| console.log(icons) |
This file contains hidden or 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
| const o = { | |
| c: 'c', | |
| d: 'd' | |
| } | |
| export const {c} = o | |
| export const {d} = o |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment