This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

24
node_modules/rxjs/dist/esm/internal/firstValueFrom.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import { EmptyError } from './util/EmptyError';
import { SafeSubscriber } from './Subscriber';
export function firstValueFrom(source, config) {
const hasConfig = typeof config === 'object';
return new Promise((resolve, reject) => {
const subscriber = new SafeSubscriber({
next: (value) => {
resolve(value);
subscriber.unsubscribe();
},
error: reject,
complete: () => {
if (hasConfig) {
resolve(config.defaultValue);
}
else {
reject(new EmptyError());
}
},
});
source.subscribe(subscriber);
});
}
//# sourceMappingURL=firstValueFrom.js.map