File tree 2 files changed +24
-2
lines changed
perf/micro/immediate-scheduler/operators
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change
1
+ var RxOld = require ( 'rx' ) ;
2
+ var RxNew = require ( '../../../../index' ) ;
3
+
4
+ module . exports = function ( suite ) {
5
+ function add ( acc , x ) {
6
+ return x + x ;
7
+ }
8
+
9
+ var oldScanScalarWithImmediateScheduler = RxOld . Observable . of ( 25 , RxOld . Scheduler . immediate ) . scan ( add ) ;
10
+ var newScanScalarWithImmediateScheduler = RxNew . Observable . of ( 25 ) . scan ( add ) ;
11
+
12
+ function _next ( x ) { }
13
+ function _error ( e ) { }
14
+ function _complete ( ) { }
15
+ return suite
16
+ . add ( 'old scalar observable scan with immediate scheduler with no seed' , function ( ) {
17
+ oldScanScalarWithImmediateScheduler . subscribe ( _next , _error , _complete ) ;
18
+ } )
19
+ . add ( 'new scalar observable scan with immediate scheduler with no seed' , function ( ) {
20
+ newScanScalarWithImmediateScheduler . subscribe ( _next , _error , _complete ) ;
21
+ } ) ;
22
+ } ;
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ module.exports = function (suite) {
6
6
return x + x ;
7
7
}
8
8
9
- var oldScanScalarWithImmediateScheduler = RxOld . Observable . of ( 25 , RxOld . Scheduler . immediate ) . scan ( add ) ;
10
- var newScanScalarWithImmediateScheduler = RxNew . Observable . of ( 25 ) . scan ( add ) ;
9
+ var oldScanScalarWithImmediateScheduler = RxOld . Observable . of ( 25 , RxOld . Scheduler . immediate ) . scan ( add , 0 ) ;
10
+ var newScanScalarWithImmediateScheduler = RxNew . Observable . of ( 25 ) . scan ( add , 0 ) ;
11
11
12
12
function _next ( x ) { }
13
13
function _error ( e ) { }
You can’t perform that action at this time.
0 commit comments