initial commit - far from runnable
This commit is contained in:
commit
db057ce342
8614 changed files with 1032171 additions and 0 deletions
22
node_modules/rxjs/dist/esm/internal/operators/takeLast.js
generated
vendored
Normal file
22
node_modules/rxjs/dist/esm/internal/operators/takeLast.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { EMPTY } from '../observable/empty';
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
export function takeLast(count) {
|
||||
return count <= 0
|
||||
? () => EMPTY
|
||||
: operate((source, subscriber) => {
|
||||
let buffer = [];
|
||||
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
||||
buffer.push(value);
|
||||
count < buffer.length && buffer.shift();
|
||||
}, () => {
|
||||
for (const value of buffer) {
|
||||
subscriber.next(value);
|
||||
}
|
||||
subscriber.complete();
|
||||
}, undefined, () => {
|
||||
buffer = null;
|
||||
}));
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=takeLast.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue