1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

chore(view-cache): [PM-21154] Move view-cache its own feature package and adjust imports

* Moved view-cache services to directory

* Fixed DI for browser extension.

* Fixed tests.
This commit is contained in:
Todd Martin
2025-05-12 14:26:52 -04:00
committed by GitHub
parent a10b9530af
commit eed18c9294
21 changed files with 155 additions and 26 deletions

View File

@@ -1,33 +0,0 @@
import { Injectable, signal, WritableSignal } from "@angular/core";
import type { FormGroup } from "@angular/forms";
import {
FormCacheOptions,
SignalCacheOptions,
ViewCacheService,
} from "../abstractions/view-cache.service";
/**
* The functionality of the {@link ViewCacheService} is only needed in the browser extension popup,
* yet is provided to all clients to make sharing components easier.
*
* Non-extension clients use this noop implementation.
* */
@Injectable({
providedIn: "root",
})
export class NoopViewCacheService implements ViewCacheService {
/**
* Return a normal signal.
*/
signal<T>(options: SignalCacheOptions<T>): WritableSignal<T> {
return signal(options.initialValue);
}
/**
* Return the original form group.
**/
formGroup<TFormGroup extends FormGroup>(options: FormCacheOptions<TFormGroup>): TFormGroup {
return options.control;
}
}