diff --git a/src/Rx.KitchenSink.ts b/src/Rx.KitchenSink.ts index 86b8fbfea5..ce3592da26 100644 --- a/src/Rx.KitchenSink.ts +++ b/src/Rx.KitchenSink.ts @@ -137,6 +137,7 @@ import {BehaviorSubject} from './subject/BehaviorSubject'; import {ConnectableObservable} from './observable/ConnectableObservable'; import {Notification} from './Notification'; import {EmptyError} from './util/EmptyError'; +import {ObjectUnsubscribedError} from './util/ObjectUnsubscribedError'; import {ArgumentOutOfRangeError} from './util/ArgumentOutOfRangeError'; import {nextTick} from './scheduler/nextTick'; import {immediate} from './scheduler/immediate'; @@ -167,6 +168,7 @@ export { Notification, EmptyError, ArgumentOutOfRangeError, + ObjectUnsubscribedError, TestScheduler, VirtualTimeScheduler, TimeInterval diff --git a/src/Rx.ts b/src/Rx.ts index 7a4d54176d..c10cd6d5f8 100644 --- a/src/Rx.ts +++ b/src/Rx.ts @@ -117,7 +117,7 @@ import {ConnectableObservable} from './observable/ConnectableObservable'; import {Notification} from './Notification'; import {EmptyError} from './util/EmptyError'; import {ArgumentOutOfRangeError} from './util/ArgumentOutOfRangeError'; -import {nextTick} from './scheduler/nextTick'; +import {ObjectUnsubscribedError} from './util/ObjectUnsubscribedError'; import {immediate} from './scheduler/immediate'; import {NextTickScheduler} from './scheduler/NextTickScheduler'; import {ImmediateScheduler} from './scheduler/ImmediateScheduler'; @@ -142,5 +142,6 @@ export { ConnectableObservable, Notification, EmptyError, - ArgumentOutOfRangeError + ArgumentOutOfRangeError, + ObjectUnsubscribedError }; diff --git a/src/util/ObjectUnsubscribedError.ts b/src/util/ObjectUnsubscribedError.ts new file mode 100644 index 0000000000..4ac0a43470 --- /dev/null +++ b/src/util/ObjectUnsubscribedError.ts @@ -0,0 +1,10 @@ +/** + * an error thrown when an action is invalid because the object + * has been unsubscribed + */ +export class ObjectUnsubscribedError extends Error { + constructor() { + super('object unsubscribed'); + this.name = 'ObjectUnsubscribedError'; + } +} \ No newline at end of file