Template base para proyectos SaaS multi-tenant. Estructura inicial: - apps/backend (NestJS API) - apps/frontend (React/Vite) - apps/database (PostgreSQL DDL) - docs/ (Documentación) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
24 lines
784 B
JavaScript
24 lines
784 B
JavaScript
import { EmptyError } from './util/EmptyError';
|
|
import { SafeSubscriber } from './Subscriber';
|
|
export function firstValueFrom(source, config) {
|
|
var hasConfig = typeof config === 'object';
|
|
return new Promise(function (resolve, reject) {
|
|
var subscriber = new SafeSubscriber({
|
|
next: function (value) {
|
|
resolve(value);
|
|
subscriber.unsubscribe();
|
|
},
|
|
error: reject,
|
|
complete: function () {
|
|
if (hasConfig) {
|
|
resolve(config.defaultValue);
|
|
}
|
|
else {
|
|
reject(new EmptyError());
|
|
}
|
|
},
|
|
});
|
|
source.subscribe(subscriber);
|
|
});
|
|
}
|
|
//# sourceMappingURL=firstValueFrom.js.map
|