Migrate to stylistic

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2024-10-16 16:43:07 +01:00
parent d8052e6a73
commit 6c6bf811a6
124 changed files with 239 additions and 196 deletions

View File

@@ -34,7 +34,7 @@ export const UPDATE_EVENT = "update";
* To update the state, use updateState() and preferably await the result to
* help prevent lock conflicts.
*/
export abstract class AsyncStore<T extends Object> extends EventEmitter {
export abstract class AsyncStore<T extends object> extends EventEmitter {
private storeState: Readonly<T>;
private lock = new AwaitLock();
private readonly dispatcherRef: string;
@@ -72,7 +72,7 @@ export abstract class AsyncStore<T extends Object> extends EventEmitter {
* Updates the state of the store.
* @param {T|*} newState The state to update in the store using Object.assign()
*/
protected async updateState(newState: T | Object): Promise<void> {
protected async updateState(newState: T | object): Promise<void> {
await this.lock.acquireAsync();
try {
this.storeState = Object.freeze(Object.assign(<T>{}, this.storeState, newState));
@@ -87,7 +87,7 @@ export abstract class AsyncStore<T extends Object> extends EventEmitter {
* @param {T|*} newState The new state of the store.
* @param {boolean} quiet If true, the function will not raise an UPDATE_EVENT.
*/
protected async reset(newState: T | Object | null = null, quiet = false): Promise<void> {
protected async reset(newState: T | object | null = null, quiet = false): Promise<void> {
await this.lock.acquireAsync();
try {
this.storeState = Object.freeze(<T>(newState || {}));