Merge pull request #5773 from backstage/rugvip/observable

core-api: add global definition of Symbol.observable
This commit is contained in:
Patrik Oldsberg
2021-05-21 19:53:20 +02:00
committed by GitHub
2 changed files with 13 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-api': patch
---
Add a global type definition for `Symbol.observable`, fix type checking in projects that didn't already have it defined.
+8
View File
@@ -42,6 +42,14 @@ export type Subscription = {
readonly closed: boolean;
};
// Declares the global well-known Symbol.observable
// We get the actual runtime polyfill from zen-observable
declare global {
interface SymbolConstructor {
readonly observable: symbol;
}
}
/**
* Observable sequence of values and errors, see TC39.
*