bitwarden-estensione-browser/apps/browser/src/background/service_factories/organization-service.factor...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
940 B
TypeScript
Raw Normal View History

import { OrganizationService as AbstractOrganizationService } from "@bitwarden/common/abstractions/organization/organization.service.abstraction";
import { OrganizationService } from "@bitwarden/common/services/organization/organization.service";
import { FactoryOptions, CachedServices, factory } from "./factory-options";
import { stateServiceFactory, StateServiceInitOptions } from "./state-service.factory";
type OrganizationServiceFactoryOptions = FactoryOptions;
export type OrganizationServiceInitOptions = OrganizationServiceFactoryOptions &
StateServiceInitOptions;
export function organizationServiceFactory(
cache: { organizationService?: AbstractOrganizationService } & CachedServices,
opts: OrganizationServiceInitOptions
): Promise<AbstractOrganizationService> {
return factory(
cache,
"organizationService",
opts,
async () => new OrganizationService(await stateServiceFactory(cache, opts))
);
}