From 536a6a6dc2e0d08dccce9ba33beca997a9975722 Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Thu, 12 Nov 2015 12:08:53 +0200 Subject: [PATCH] fix(operators): Remove shareReplay and shareBehavior Remove two operators that were reintroduced by mistake. shareReplay and shareBehavior should not exist anymore. Resolves issue #710. --- .../operators/sharebehavior.js | 20 ------------------- .../operators/sharereplay.js | 20 ------------------- src/Observable.ts | 2 -- src/operators/shareReplay.ts | 8 -------- 4 files changed, 50 deletions(-) delete mode 100644 perf/micro/immediate-scheduler/operators/sharebehavior.js delete mode 100644 perf/micro/immediate-scheduler/operators/sharereplay.js delete mode 100644 src/operators/shareReplay.ts diff --git a/perf/micro/immediate-scheduler/operators/sharebehavior.js b/perf/micro/immediate-scheduler/operators/sharebehavior.js deleted file mode 100644 index b0c3779128..0000000000 --- a/perf/micro/immediate-scheduler/operators/sharebehavior.js +++ /dev/null @@ -1,20 +0,0 @@ -var RxOld = require('rx'); -var RxNew = require('../../../../index'); - -module.exports = function (suite) { - var oldShareBehaviorWithImmediateScheduler = RxOld.Observable.range(0, 25, RxOld.Scheduler.immediate) - .shareValue(0); - var newShareBehaviorWithImmediateScheduler = RxNew.Observable.range(0, 25) - .shareBehavior(0); - - function _next(x) { } - function _error(e) { } - function _complete() { } - return suite - .add('old shareBehavior with immediate scheduler', function () { - oldShareBehaviorWithImmediateScheduler.subscribe(_next, _error, _complete); - }) - .add('new shareBehavior with immediate scheduler', function () { - newShareBehaviorWithImmediateScheduler.subscribe(_next, _error, _complete); - }); -}; diff --git a/perf/micro/immediate-scheduler/operators/sharereplay.js b/perf/micro/immediate-scheduler/operators/sharereplay.js deleted file mode 100644 index 3d9fddb07e..0000000000 --- a/perf/micro/immediate-scheduler/operators/sharereplay.js +++ /dev/null @@ -1,20 +0,0 @@ -var RxOld = require('rx'); -var RxNew = require('../../../../index'); - -module.exports = function (suite) { - var oldShareReplayWithImmediateScheduler = RxOld.Observable.range(0, 25, RxOld.Scheduler.immediate) - .shareReplay(3); - var newShareReplayWithImmediateScheduler = RxNew.Observable.range(0, 25) - .shareReplay(3); - - function _next(x) { } - function _error(e) { } - function _complete() { } - return suite - .add('old shareReplay with immediate scheduler', function () { - oldShareReplayWithImmediateScheduler.subscribe(_next, _error, _complete); - }) - .add('new shareReplay with immediate scheduler', function () { - newShareReplayWithImmediateScheduler.subscribe(_next, _error, _complete); - }); -}; diff --git a/src/Observable.ts b/src/Observable.ts index f861100ddb..c8764b3be8 100644 --- a/src/Observable.ts +++ b/src/Observable.ts @@ -216,8 +216,6 @@ export class Observable implements CoreOperators { sampleTime: (delay: number, scheduler?: Scheduler) => Observable; scan: (project: (acc: R, x: T) => R, acc?: R) => Observable; share: () => Observable; - shareBehavior: (value: T) => Observable; - shareReplay: (bufferSize: number, windowTime: number, scheduler?: Scheduler) => Observable; single: (predicate?: (value: T, index: number) => boolean, thisArg?: any) => Observable; skip: (count: number) => Observable; skipUntil: (notifier: Observable) => Observable; diff --git a/src/operators/shareReplay.ts b/src/operators/shareReplay.ts deleted file mode 100644 index 7034485d36..0000000000 --- a/src/operators/shareReplay.ts +++ /dev/null @@ -1,8 +0,0 @@ -import {Scheduler} from '../Scheduler'; -import {publishReplay} from './publishReplay'; - -export function shareReplay(bufferSize: number = Number.POSITIVE_INFINITY, - windowTime: number = Number.POSITIVE_INFINITY, - scheduler?: Scheduler) { - return publishReplay.call(this, bufferSize, windowTime, scheduler).refCount(); -}