Add web front-end and fix API issues
This commit is contained in:
1 parent
45ca4de0ad
commit
a7524412f0
2571 files changed
+86998
-5
No files matched your search
+24
@@ -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
|
||||
Reference in new issue
Block a user