From 3eb12dc0b14c48b5ded8e320421e1bf55e638c6b Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Tue, 2 Jan 2018 10:35:33 +0200 Subject: [PATCH] Update runAsync.md --- snippets/runAsync.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/snippets/runAsync.md b/snippets/runAsync.md index eabd79e18..8ab34943e 100644 --- a/snippets/runAsync.md +++ b/snippets/runAsync.md @@ -1,12 +1,10 @@ ### runAsync -Runs a function in a separate thread by using a Web Worker, allowing -long running functions to not block the UI. +Runs a function in a separate thread by using a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers), allowing long running functions to not block the UI. -Create a new `Worker` using a `Blob` object URL, the contents of which should be the -stringified version of the supplied function. Immediately post the return value of calling -the function back. Return a promise, listening for `onmessage` and `onerror` events -and resolving the data posted back from the worker, or throwing an error. +Create a new `Worker` using a `Blob` object URL, the contents of which should be the stringified version of the supplied function. +Immediately post the return value of calling the function back. +Return a promise, listening for `onmessage` and `onerror` events and resolving the data posted back from the worker, or throwing an error. ```js const runAsync = fn => {