monaco-yaml/src/yaml.worker.ts
Remco Haszing 8fa3ca4252
Convert classes to factory functions
TypeScript is better at inferring types when using simple functions and
objects instead of classes. As a result many type annotations have now
been removed without impacting type safety.

Some other benefits are this can be minified better and private fields
are now truly private variables.
2021-08-19 17:06:42 +02:00

7 lines
236 B
TypeScript

import { initialize } from 'monaco-editor/esm/vs/editor/editor.worker';
import { createYAMLWorker } from './yamlWorker';
self.onmessage = () => {
initialize((ctx, createData) => Object.create(createYAMLWorker(ctx, createData)));
};