"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const rxjs_1 = require("rxjs");
function ObservableToBS(src) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        return new Promise((resolve) => {
            let bs;
            src.subscribe((next) => {
                if (bs === undefined) {
                    bs = new rxjs_1.BehaviorSubject(next);
                    resolve(bs);
                }
                else {
                    bs.next(next);
                }
            });
        });
    });
}
exports.ObservableToBS = ObservableToBS;
