1
0
mirror of https://github.com/bitwarden/directory-connector synced 2026-01-21 11:53:38 +00:00
Files
directory-connector/jslib/common/src/factories/globalStateFactory.ts
2022-04-28 16:41:07 +02:00

14 lines
414 B
TypeScript

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);
}
}