Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revive zen-observable-ts wrapper for zen-observable package. #7615

Merged
merged 1 commit into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
},
"dependencies": {
"@graphql-typed-document-node/core": "^3.0.0",
"@types/zen-observable": "^0.8.0",
"@wry/context": "^0.5.2",
"@wry/equality": "^0.3.0",
"@wry/trie": "^0.2.1",
Expand All @@ -86,7 +85,7 @@
"symbol-observable": "^2.0.0",
"ts-invariant": "^0.6.0",
"tslib": "^1.10.0",
"zen-observable": "^0.8.14"
"zen-observable-ts": "^1.0.0-beta.4"
},
"devDependencies": {
"@babel/parser": "7.12.11",
Expand Down
13 changes: 10 additions & 3 deletions src/utilities/observables/Observable.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import Observable from 'zen-observable';
import {
Observable,
Observer,
Subscription as ObservableSubscription,
} from 'zen-observable-ts';

// This simplified polyfill attempts to follow the ECMAScript Observable
// proposal (https://github.com/zenparsing/es-observable)
import 'symbol-observable';

export type ObservableSubscription = ZenObservable.Subscription;
export type Observer<T> = ZenObservable.Observer<T>;
export type {
Observer,
ObservableSubscription,
};

// Use global module augmentation to add RxJS interop functionality. By
// using this approach (instead of subclassing `Observable` and adding an
Expand All @@ -18,4 +24,5 @@ declare global {
}
}
(Observable.prototype as any)['@@observable'] = function () { return this; };

export { Observable };