EO
Size: a a a
EO
DB
EO
EO
DB
EO
EO
AG
const thread = require('elegant-threading');
const heavyCalculations = thread(function heavyCalculations(a, b, c) {
// yep, console methods also work despite the fact that this is a Worker
console.log('calculating a heavy thing');
return calculateHeavyThing(a, b, c);
});
// main thread isn't blocked anymore
const result = await heavyCalculations(a, b, c);
EO
const thread = require('elegant-threading');
const heavyCalculations = thread(function heavyCalculations(a, b, c) {
// yep, console methods also work despite the fact that this is a Worker
console.log('calculating a heavy thing');
return calculateHeavyThing(a, b, c);
});
// main thread isn't blocked anymore
const result = await heavyCalculations(a, b, c);
EO
AG
EO
Вт
toObject<T extends ShapeObject>(): T {
return {
type: this.constructor.name,
options: {
text: this._text,
width: this._width,
height: this._height,
x: this._x,
y: this._y,
background: this._background,
foreground: this._foreground
}
} as ShapeObject;
}
EO
EO
EO
Вт
Вт
EO