Skip to content

Commit 566f46b

Browse files
perf(DeferSubscriber): split up 'tryDefer()' into a method to call a factory function.
1 parent d851194 commit 566f46b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/observable/DeferObservable.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,16 @@ class DeferSubscriber<T> extends OuterSubscriber<T, T> {
7373

7474
private tryDefer(): void {
7575
try {
76-
const result = this.factory.call(this);
77-
if (result) {
78-
this.add(subscribeToResult(this, result));
79-
}
76+
this._callFactory();
8077
} catch (err) {
8178
this._error(err);
8279
}
8380
}
81+
82+
private _callFactory(): void {
83+
const result = this.factory();
84+
if (result) {
85+
this.add(subscribeToResult(this, result));
86+
}
87+
}
8488
}

0 commit comments

Comments
 (0)