mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-27 18:57:42 +00:00
Add example to docs for LMLayer.asBlobURI().
This commit is contained in:
parent
6cc20cfd83
commit
ac12cb6f28
1 changed files with 9 additions and 0 deletions
|
|
@ -61,6 +61,15 @@ class LMLayer {
|
|||
* Converts the INSIDE of a function into a blob URI that can
|
||||
* be passed as a valid URI for a Worker.
|
||||
* @param fn Function whose body will be referenced by a URI.
|
||||
*
|
||||
* This function makes the following possible:
|
||||
*
|
||||
* let worker = new Worker(LMLayer.asBlobURI(function myWorkerCode () {
|
||||
* postMessage('inside Web Worker')
|
||||
* function onmessage(event) {
|
||||
* // handle message inside Web Worker.
|
||||
* }
|
||||
* }));
|
||||
*/
|
||||
static asBlobURI(fn: Function): string {
|
||||
let code = LMLayer.unwrap(fn);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue