diff --git a/common/predictive-text/index.ts b/common/predictive-text/index.ts index 7b67d6acb4..e739569833 100644 --- a/common/predictive-text/index.ts +++ b/common/predictive-text/index.ts @@ -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);