"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.switchPartition = void 0;
const rxjs_1 = require("rxjs");
/**
 * Applies a dictionary of filter predicates on the source observable and returns an object of observables.
 *
 * @param source - Source observable.
 * @param filters - A dictionary of filter predicates.
 * @returns An object of observables with keys corresponding to the dictionary.
 */
function switchPartition(source, filters) {
    const keys = Object.keys(filters);
    return keys.reduce((acc, key) => {
        acc[key] = source.pipe((0, rxjs_1.filter)(filters[key]));
        return acc;
    }, {});
}
exports.switchPartition = switchPartition;
//# sourceMappingURL=switchPartition.js.map