Skip to content

Commit

Permalink
use .js for web worker
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Apr 26, 2019
1 parent 62ae637 commit 47ee968
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/USING_ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Marked can be run in a [worker thread](https://nodejs.org/api/worker_threads.htm
### Node Worker Thread

> 🚨 Node Worker Threads are [experimental](https://nodejs.org/api/worker_threads.html#worker_threads_worker_threads) 🚨
>
> This implementation may change.
```js
Expand Down Expand Up @@ -134,8 +135,9 @@ onmessage = (e) => {
};
```

```html
<script>
```js
// script.js

const markedWorker = new Worker('markedWorker.js');

const markedTimeout = setTimeout(() => {
Expand All @@ -151,5 +153,4 @@ markedWorker.onmessage = (e) => {
};

markedWorker.postMessage(markdownString);
</script>
```

0 comments on commit 47ee968

Please sign in to comment.