Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added ES6 import #396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ The FOUT can be more easily avoided when loading the Web Font Loader synchronous
Web Font Loader is also available on npm as a CommonJS module. Just `npm install webfontloader` and then require it in your code.

```js
var WebFont = require('webfontloader');
var WebFont = require('webfontloader');
// or for ES6 import

Choose a reason for hiding this comment

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

You should probably move this to a separate code block. The original state of this example allows for copy-paste.

Perhaps an abbreviated code block that does nothing but provide the ES6 import.

import WebFont from 'webfontloader'

WebFont.load({
google: {
families: ['Droid Sans', 'Droid Serif']
}
});
WebFont.load({
google: {
families: ['Droid Sans', 'Droid Serif']
}
});
```

## Configuration
Expand Down