mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 03:33:54 +00:00
[PM-16793] port credential generator service to providers (#14071)
* introduce extension service * deprecate legacy forwarder types * eliminate repeat algorithm emissions * extend logging to preference management * align forwarder ids with vendor ids * fix duplicate policy emissions; debugging required logger enhancements ----- Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
This commit is contained in:
@@ -15,4 +15,9 @@ export abstract class UserStateSubjectDependencyProvider {
|
||||
// FIXME: remove `log` and inject the system provider into the USS instead
|
||||
/** Provides semantic logging */
|
||||
abstract log: <Context extends object>(_context: Jsonify<Context>) => SemanticLogger;
|
||||
|
||||
/** Get the system time as a number of seconds since the unix epoch
|
||||
* @remarks this can be turned into a date using `new Date(provider.now())`
|
||||
*/
|
||||
abstract now: () => number;
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ const SomeProvider = {
|
||||
} as LegacyEncryptorProvider,
|
||||
state: SomeStateProvider,
|
||||
log: disabledSemanticLoggerProvider,
|
||||
now: () => 100,
|
||||
};
|
||||
|
||||
function fooMaxLength(maxLength: number): StateConstraints<TestType> {
|
||||
|
||||
@@ -477,7 +477,12 @@ export class UserStateSubject<
|
||||
* @returns the subscription
|
||||
*/
|
||||
subscribe(observer?: Partial<Observer<State>> | ((value: State) => void) | null): Subscription {
|
||||
return this.output.pipe(map((wc) => wc.state)).subscribe(observer);
|
||||
return this.output
|
||||
.pipe(
|
||||
map((wc) => wc.state),
|
||||
distinctUntilChanged(),
|
||||
)
|
||||
.subscribe(observer);
|
||||
}
|
||||
|
||||
// using subjects to ensure the right semantics are followed;
|
||||
|
||||
Reference in New Issue
Block a user