Skip to content

Commit 3c49429

Browse files
kwonojcartant
andauthored
fix(symbol): revert unique symbol in #5874 (#6224)
* fix(symbol): revert unique symbol in #5874 - closes #5919 * fix(types): move Symbol.observable into types.ts (#6178) Closes #6175 Co-authored-by: Nicholas Jamieson <[email protected]>
1 parent ce0a2fa commit 3c49429

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

api_guard/dist/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export interface ObjectUnsubscribedError extends Error {
240240

241241
export declare const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor;
242242

243-
export declare const observable: string | SymbolConstructor["observable"];
243+
export declare const observable: string | symbol;
244244

245245
export declare class Observable<T> implements Subscribable<T> {
246246
protected operator: Operator<any, T> | undefined;

src/internal/types.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,12 @@ import { Observable } from './Observable';
55
import { Subscription } from './Subscription';
66

77
/**
8-
* NOTE: This will add Symbol.observable globally for all TypeScript users,
9-
* however, we are no longer polyfilling Symbol.observable. Note that this will be at
10-
* odds with older version of @types/node and symbol-observable which incorrectly define
11-
* `Symbol.observable` as `symbol` rather than `unique symbol`. "What about not defining
12-
* this non-standard symbol at all?" you might ask... Well, that ship has sailed. There are
13-
* dozens of libraries using this symbol now and many of them are quite popular.
14-
* So here we are, and it's probably my fault. Sorry, "the web", if I have hurt you,
15-
* the world just needed a standard way to provide interop for these types. -Ben
8+
* Note: This will add Symbol.observable globally for all TypeScript users,
9+
* however, we are no longer polyfilling Symbol.observable
1610
*/
1711
declare global {
1812
interface SymbolConstructor {
19-
readonly observable: unique symbol;
13+
readonly observable: symbol;
2014
}
2115
}
2216

0 commit comments

Comments
 (0)