@effection/subscription
Advanced tools
Comparing version 0.8.1 to 0.9.0
# @effection/subscription | ||
## 0.9.0 | ||
### Minor Changes | ||
- 786b20e: make the type of SymbolSubscribable global, not just the value | ||
## 0.8.1 | ||
@@ -4,0 +10,0 @@ |
export { Subscription, createSubscription } from './subscription'; | ||
export { SymbolSubscribable, SubscriptionSource, forEach, Subscribable } from './subscribable'; | ||
export { SymbolSubscribable } from './symbol-subscribable'; | ||
export { SubscriptionSource, forEach, Subscribable } from './subscribable'; | ||
export { ChainableSubscription } from './chainable-subscription'; | ||
@@ -4,0 +5,0 @@ import { Operation } from 'effection'; |
import { Operation } from 'effection'; | ||
import { Subscription, Subscriber } from './subscription'; | ||
import { DeepPartial } from './match'; | ||
export declare const SymbolSubscribable: unique symbol; | ||
import { SymbolSubscribable } from './symbol-subscribable'; | ||
export interface Subscribable<T, TReturn> { | ||
@@ -6,0 +6,0 @@ [SymbolSubscribable](): Operation<Subscription<T, TReturn>>; |
@@ -23,2 +23,20 @@ 'use strict'; | ||
/** | ||
* Hack Zone! | ||
* | ||
* tl;dr not only the symbol value, but also the symbol type must be | ||
* global. | ||
* | ||
* In order to satisfy TypeScript that the SymbolSubscribable | ||
* represents the same value across different versions of the same | ||
* package, we need to declare a "fake" global variable that does not | ||
* actually exist, but has a theoretical type. Since it is global, | ||
* TypeScript will see it as the same type everywhere, and so we can | ||
* use the `typeof` for the value, as the type of of our local symbol | ||
* subscribable, and TypeScript will think that all of the types are | ||
* the same. | ||
* | ||
* See https://github.com/microsoft/TypeScript/issues/8099#issuecomment-210134773 | ||
* for details. | ||
*/ | ||
var SymbolSubscribable = /*#__PURE__*/Symbol["for"]('Symbol.subscription'); | ||
@@ -25,0 +43,0 @@ |
@@ -21,2 +21,20 @@ import { resource } from 'effection'; | ||
/** | ||
* Hack Zone! | ||
* | ||
* tl;dr not only the symbol value, but also the symbol type must be | ||
* global. | ||
* | ||
* In order to satisfy TypeScript that the SymbolSubscribable | ||
* represents the same value across different versions of the same | ||
* package, we need to declare a "fake" global variable that does not | ||
* actually exist, but has a theoretical type. Since it is global, | ||
* TypeScript will see it as the same type everywhere, and so we can | ||
* use the `typeof` for the value, as the type of of our local symbol | ||
* subscribable, and TypeScript will think that all of the types are | ||
* the same. | ||
* | ||
* See https://github.com/microsoft/TypeScript/issues/8099#issuecomment-210134773 | ||
* for details. | ||
*/ | ||
var SymbolSubscribable = /*#__PURE__*/Symbol["for"]('Symbol.subscription'); | ||
@@ -23,0 +41,0 @@ |
{ | ||
"name": "@effection/subscription", | ||
"version": "0.8.1", | ||
"version": "0.9.0", | ||
"description": "Effection Subscriptions", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
export { Subscription, createSubscription } from './subscription'; | ||
export { SymbolSubscribable, SubscriptionSource, forEach, Subscribable } from './subscribable'; | ||
export { SymbolSubscribable } from './symbol-subscribable'; | ||
export { SubscriptionSource, forEach, Subscribable } from './subscribable'; | ||
export { ChainableSubscription } from './chainable-subscription'; | ||
@@ -4,0 +5,0 @@ |
import { Operation } from 'effection'; | ||
import { Subscription, createSubscription, Subscriber } from './subscription'; | ||
import { DeepPartial, matcher } from './match'; | ||
import { SymbolSubscribable } from './symbol-subscribable'; | ||
export const SymbolSubscribable: unique symbol = Symbol.for('Symbol.subscription'); | ||
export interface Subscribable<T,TReturn> { | ||
@@ -8,0 +7,0 @@ [SymbolSubscribable](): Operation<Subscription<T,TReturn>>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82468
24
885