20 lines
446 B
JavaScript
20 lines
446 B
JavaScript
// `call`, just like a function.
|
|
export class RawTask {
|
|
call() {
|
|
try {
|
|
this.task && this.task();
|
|
} catch (error) {
|
|
this.onError(error);
|
|
} finally{
|
|
this.task = null;
|
|
this.release(this);
|
|
}
|
|
}
|
|
constructor(onError, release){
|
|
this.onError = onError;
|
|
this.release = release;
|
|
this.task = null;
|
|
}
|
|
}
|
|
|
|
//# sourceMappingURL=RawTask.js.map
|