TenantAtlas/apps/platform/.pnpm-store/v10/files/92/9df8ca2a8103eda3907fe4a51f0859e2358a06d1ef0e41479db719d65680df5cdb569759d79d128fa25dbd9710144b88c8d82f7582916babfd36033323b2a5
Ahmed Darrazi 9f74f7a658
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 51s
feat: compress governance operator outcomes
2026-04-19 14:15:11 +02:00

20 lines
659 B
Plaintext

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