mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
Move to libs
This commit is contained in:
13
libs/common/src/factories/globalStateFactory.ts
Normal file
13
libs/common/src/factories/globalStateFactory.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { GlobalState } from "../models/domain/globalState";
|
||||
|
||||
export class GlobalStateFactory<T extends GlobalState = GlobalState> {
|
||||
private globalStateConstructor: new (init: Partial<T>) => T;
|
||||
|
||||
constructor(globalStateConstructor: new (init: Partial<T>) => T) {
|
||||
this.globalStateConstructor = globalStateConstructor;
|
||||
}
|
||||
|
||||
create(args?: Partial<T>) {
|
||||
return new this.globalStateConstructor(args);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user