Skip to content

CommonJS example: make difference smaller#5

Open
mathiasbynens wants to merge 1 commit into
wycats:masterfrom
mathiasbynens:patch-1
Open

CommonJS example: make difference smaller#5
mathiasbynens wants to merge 1 commit into
wycats:masterfrom
mathiasbynens:patch-1

Conversation

@mathiasbynens
Copy link
Copy Markdown

No description provided.

Comment thread source/cjs.md
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s no reason to do this in the ES6 version but not here, IMHO.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason was purely because that is how it was done in the original source. But you're right, this is an example and parity is useful.

I'll noodle on it.

Comment thread source/cjs.md
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@calvinmetcalf
Copy link
Copy Markdown

switching it on the other side e.g. import * as util from "util"; would work too and help illustrate the different ways to import different types of exports, plus it keeps it more idiomatic on the cjs side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants