Initial commit: Book management system with Rust Loco backend and Vue 3 frontend
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
import { EMPTY } from '../observable/empty';
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
export function take(count) {
|
||||
return count <= 0
|
||||
?
|
||||
() => EMPTY
|
||||
: operate((source, subscriber) => {
|
||||
let seen = 0;
|
||||
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
||||
if (++seen <= count) {
|
||||
subscriber.next(value);
|
||||
if (count <= seen) {
|
||||
subscriber.complete();
|
||||
}
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=take.js.map
|
||||
Reference in New Issue
Block a user