Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
16 lines
No EOL
640 B
Text
16 lines
No EOL
640 B
Text
import { EmptyError } from '../util/EmptyError';
|
|
import { operate } from '../util/lift';
|
|
import { createOperatorSubscriber } from './OperatorSubscriber';
|
|
export function throwIfEmpty(errorFactory = defaultErrorFactory) {
|
|
return operate((source, subscriber) => {
|
|
let hasValue = false;
|
|
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
hasValue = true;
|
|
subscriber.next(value);
|
|
}, () => (hasValue ? subscriber.complete() : subscriber.error(errorFactory()))));
|
|
});
|
|
}
|
|
function defaultErrorFactory() {
|
|
return new EmptyError();
|
|
}
|
|
//# sourceMappingURL=throwIfEmpty.js.map |