Skip to content

Commit 9948dc2

Browse files
authored
fix: share and connect no longer bundle scheduling code by default (#6873)
resolves #6872
1 parent a1ef8f8 commit 9948dc2

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/internal/observable/innerFrom.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { isArrayLike } from '../util/isArrayLike';
22
import { isPromise } from '../util/isPromise';
33
import { Observable } from '../Observable';
4-
import { ObservableInput, ReadableStreamLike } from '../types';
4+
import { ObservableInput, ObservedValueOf, ReadableStreamLike } from '../types';
55
import { isInteropObservable } from '../util/isInteropObservable';
66
import { isAsyncIterable } from '../util/isAsyncIterable';
77
import { createInvalidObservableTypeError } from '../util/throwUnobservableError';
@@ -12,6 +12,7 @@ import { isFunction } from '../util/isFunction';
1212
import { reportUnhandledError } from '../util/reportUnhandledError';
1313
import { observable as Symbol_observable } from '../symbol/observable';
1414

15+
export function innerFrom<O extends ObservableInput<any>>(input: O): Observable<ObservedValueOf<O>>;
1516
export function innerFrom<T>(input: ObservableInput<T>): Observable<T> {
1617
if (input instanceof Observable) {
1718
return input;

src/internal/operators/connect.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { OperatorFunction, ObservableInput, ObservedValueOf, SubjectLike } from '../types';
22
import { Observable } from '../Observable';
33
import { Subject } from '../Subject';
4-
import { from } from '../observable/from';
4+
import { innerFrom } from '../observable/innerFrom';
55
import { operate } from '../util/lift';
66
import { fromSubscribable } from '../observable/fromSubscribable';
77

@@ -103,7 +103,7 @@ export function connect<T, O extends ObservableInput<unknown>>(
103103
const { connector } = config;
104104
return operate((source, subscriber) => {
105105
const subject = connector();
106-
from(selector(fromSubscribable(subject))).subscribe(subscriber);
106+
innerFrom(selector(fromSubscribable(subject))).subscribe(subscriber);
107107
subscriber.add(source.subscribe(subject));
108108
});
109109
}

src/internal/operators/onErrorResumeNext.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function onErrorResumeNext<T, A extends readonly unknown[]>(
101101
if (remaining.length > 0) {
102102
let nextSource: Observable<A[number]>;
103103
try {
104-
nextSource = innerFrom<T | A[number]>(remaining.shift()!);
104+
nextSource = innerFrom(remaining.shift()!);
105105
} catch (err) {
106106
subscribeNext();
107107
return;

src/internal/operators/share.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Observable } from '../Observable';
2-
import { from } from '../observable/from';
2+
import { innerFrom } from '../observable/innerFrom';
33
import { take } from '../operators/take';
44
import { Subject } from '../Subject';
55
import { SafeSubscriber } from '../Subscriber';
@@ -232,7 +232,7 @@ export function share<T>(options: ShareConfig<T> = {}): MonoTypeOperatorFunction
232232
dest.complete();
233233
},
234234
});
235-
from(source).subscribe(connection);
235+
innerFrom(source).subscribe(connection);
236236
}
237237
})(wrapperSource);
238238
};

0 commit comments

Comments
 (0)