mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
format: run prettify
This commit is contained in:
@@ -1,36 +1,36 @@
|
||||
import type { Subscriber, Unsubscriber } from "svelte/store";
|
||||
|
||||
export class Standalone {
|
||||
private static instance: Standalone;
|
||||
private _standalone = $state(false);
|
||||
private subscribers = new Set<Subscriber<boolean>>();
|
||||
private static instance: Standalone;
|
||||
private _standalone = $state(false);
|
||||
private subscribers = new Set<Subscriber<boolean>>();
|
||||
|
||||
private constructor() {}
|
||||
private constructor() {}
|
||||
|
||||
public static getInstance(): Standalone {
|
||||
if (!Standalone.instance) {
|
||||
Standalone.instance = new Standalone();
|
||||
}
|
||||
return Standalone.instance;
|
||||
}
|
||||
public static getInstance(): Standalone {
|
||||
if (!Standalone.instance) {
|
||||
Standalone.instance = new Standalone();
|
||||
}
|
||||
return Standalone.instance;
|
||||
}
|
||||
|
||||
public setStandalone(value: boolean) {
|
||||
this._standalone = value;
|
||||
this.subscribers.forEach(subscriber => subscriber(value));
|
||||
}
|
||||
public setStandalone(value: boolean) {
|
||||
this._standalone = value;
|
||||
this.subscribers.forEach((subscriber) => subscriber(value));
|
||||
}
|
||||
|
||||
public get standalone() {
|
||||
return this._standalone;
|
||||
}
|
||||
public get standalone() {
|
||||
return this._standalone;
|
||||
}
|
||||
|
||||
public subscribe(run: Subscriber<boolean>): Unsubscriber {
|
||||
this.subscribers.add(run);
|
||||
run(this._standalone);
|
||||
public subscribe(run: Subscriber<boolean>): Unsubscriber {
|
||||
this.subscribers.add(run);
|
||||
run(this._standalone);
|
||||
|
||||
return () => {
|
||||
this.subscribers.delete(run);
|
||||
};
|
||||
}
|
||||
return () => {
|
||||
this.subscribers.delete(run);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export const standalone = Standalone.getInstance();
|
||||
export const standalone = Standalone.getInstance();
|
||||
|
||||
Reference in New Issue
Block a user