Mirror: 🎩 A tiny but capable push & pull stream library for TypeScript and Flow

Use a ponyfill observable instead of polyfilling (#121)

* Use a ponyfill observable instead of polyfilling

To match behaviour of other packages like RxJS (https://github.com/ReactiveX/rxjs/blob/6fa819beb91ba99dadd6262d6c13f7ddfd9470c5/src/internal/symbol/observable.ts) and redux (https://github.com/reduxjs/redux/blob/cf5043a4de63cb3a26dfb5e7e2d5a68d2d8a79f5/src/utils/symbol-observable.ts).

* Update src/observable.ts to skip Symbol support check

https://github.com/0no-co/wonka/pull/121#discussion_r1000068633

Co-authored-by: Phil Pluckthun <phil@kitten.sh>

* Fix prettier issue

Co-authored-by: Paul Gerarts <paulgerarts@weave.nl>
Co-authored-by: Phil Pluckthun <phil@kitten.sh>

Changed files
+1 -2
src
+1 -2
src/observable.ts
···
subscribe(observer: ObservableObserver<T>): ObservableSubscription;
}
-
const observableSymbol = (): symbol =>
-
(Symbol as any).observable || ((Symbol as any).observable = Symbol('observable'));
+
const observableSymbol = (): symbol | string => Symbol.observable || '@@observable';
export function fromObservable<T>(input: Observable<T>): Source<T> {
input = input[observableSymbol()] ? (input as any)[observableSymbol()]() : input;