rxjs-min-max
RxJs Operators for emits minimum/maximum value on each iteration.
Example
of1 1 2 2 2 0 1 2 3 -1 4 ; // 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4 of<Person> age: 4 name: 'Foo' age: 7 name: 'Bar' age: 3 name: 'Foo' age: 6 name: 'Foo' ; // displays: // { age: 4, name: 'Foo' } // { age: 4, name: 'Foo' } // { age: 3, name: 'Foo'}, // { age: 3, name: 'Foo'},
Performance
You can used this operators like min/max:
// equal min() / max()
If size of stream big(n > 10000), minStream(maxStream) work faster than min(max):
var rxjsMinMax = ;var rxjs = ;var last = last;var min = min; const n = 100000;const array = Array; console;rxjs;console; console;rxjs;console; // count n = 100000// 0// minStream: 11.276ms// 0// min: 40.306ms // count n = 1000000// 0// minStream: 24.084ms// 0// min: 72.204ms // count n = 10000000// 1// minStream: 137.856ms// 1// min: 437.046ms // count n = 1000// 0// minStream: 5.738ms// 0// min: 1.779ms