Snippet format update
To match the starter (for the migration)
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
### runAsync
|
||||
---
|
||||
title: runAsync
|
||||
tags: browser,function,advanced,promise,url
|
||||
---
|
||||
|
||||
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.
|
||||
|
||||
@ -41,4 +44,4 @@ runAsync(longRunningFunction).then(console.log); // 209685000000
|
||||
runAsync(() => 10 ** 3).then(console.log); // 1000
|
||||
let outsideVariable = 50;
|
||||
runAsync(() => typeof outsideVariable).then(console.log); // 'undefined'
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user