Skip to content

Commit

Permalink
use const
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Apr 25, 2019
1 parent 6471657 commit e493b75
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/USING_ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ marked(markdownString [,options] [,callback])

```js
// Create reference instance
var marked = require('marked');
const marked = require('marked');

// Set options
// `highlight` example uses `highlight.js`
Expand Down Expand Up @@ -124,23 +124,23 @@ markedWorker.postMessage(markdownString);
importScripts('path/to/marked.min.js');

onmessage = (e) => {
var markdownString = e.data
const markdownString = e.data
postMessage(marked(markdownString));
};
```

```html
<script>
var markedWorker = new Worker('markedWorker.js');
const markedWorker = new Worker('markedWorker.js');
var markedTimeout = setTimeout(() => {
const markedTimeout = setTimeout(() => {
markedWorker.terminate();
throw new Error('Marked took too long!');
}, timeoutLimit);
markedWorker.onmessage = (e) => {
clearTimeout(markedTimeout);
var html = e.data;
const html = e.data;
console.log(html);
markedWorker.terminate();
};
Expand Down

0 comments on commit e493b75

Please sign in to comment.