linx-simulator2/node_modules/mumble-client-codecs-node/lib/webworkify-node.js
2019-09-18 11:11:16 +03:00

27 lines
634 B
JavaScript

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (workerFactory) {
var worker = new _events.EventEmitter();
worker.addEventListener = worker.on;
workerFactory(worker);
var client = {
onmessage: function onmessage() {},
postMessage: function postMessage(msg) {
process.nextTick(function () {
return worker.emit('message', { data: msg });
});
}
};
worker.postMessage = function (msg) {
process.nextTick(function () {
return client.onmessage({ data: msg });
});
};
return client;
};
var _events = require('events');