1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.Thread = void 0;
|
4 | const symbols_1 = require("../symbols");
|
5 | function fail(message) {
|
6 | throw Error(message);
|
7 | }
|
8 |
|
9 | exports.Thread = {
|
10 |
|
11 | errors(thread) {
|
12 | return thread[symbols_1.$errors] || fail("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.");
|
13 | },
|
14 |
|
15 | events(thread) {
|
16 | return thread[symbols_1.$events] || fail("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.");
|
17 | },
|
18 |
|
19 | terminate(thread) {
|
20 | return thread[symbols_1.$terminate]();
|
21 | }
|
22 | };
|