UNPKG

@snap/camera-kit

Version:
20 lines 966 B
import { take } from "rxjs"; import { Injectable } from "@snap/ts-inject"; import { Namespace } from "../generated-proto/pb_schema/cdp/cof/namespace"; import { lensCoreFactory } from "../lens-core-module/loader/lensCoreFactory"; import { getLogger } from "../logger/logger"; import { remoteConfigurationFactory } from "./remoteConfiguration"; const logger = getLogger("setPreloadedConfiguration"); export const setPreloadedConfiguration = Injectable("setPreloadedConfiguration", [lensCoreFactory.token, remoteConfigurationFactory.token], (lensCore, remoteConfiguration) => { remoteConfiguration .getNamespace(Namespace.LENS_CORE_CONFIG) .pipe(take(1)) .subscribe({ next: (configs) => { const inputs = configs.map(({ configId, value }) => ({ configId, value })); lensCore.setPreloadedConfiguration(inputs); }, error: logger.error, }); }); //# sourceMappingURL=preloadConfiguration.js.map