Skip to content

Commit

Permalink
fix: subscription closed does not comply with proposal (#151)
Browse files Browse the repository at this point in the history
Co-authored-by: Phil Pluckthun <phil@kitten.sh>
  • Loading branch information
naporin0624 and kitten authored Mar 18, 2023
1 parent 990c8da commit 95c15e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-rules-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'wonka': patch
---

Make `closed: boolean` on `ObservableSubscription`s a required field to comply with the Observable proposal's type spec.
4 changes: 2 additions & 2 deletions src/observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface ObservableSubscription {
*
* @readonly
*/
closed?: boolean;
closed: boolean;
/** Cancels the subscription.
* @remarks
* This cancels the ongoing subscription and the {@link ObservableObserver}'s callbacks will
Expand Down Expand Up @@ -76,7 +76,7 @@ interface ObservableLike<T> {
* @see {@link ObservableObserver} for the callbacks in an object that are called as Observables
* issue events.
*/
subscribe(observer: ObservableObserver<T>): ObservableSubscription;
subscribe(observer: ObservableObserver<T>): { unsubscribe(): void };

/** The well-known symbol specifying the default ES Observable for an object. */
[Symbol.observable]?(): Observable<T>;
Expand Down

0 comments on commit 95c15e7

Please sign in to comment.