mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-26 11:03:21 +00:00
Refactor optional file synchronisation ownership
This commit is contained in:
1 parent
3b2d5aa5af
commit
826413bf84
67 files changed
+6294
-1856
No files matched your search
@@ -62,18 +62,6 @@ export class LiveSyncBaseCore<
|
||||
this.services.appLifecycle.onUnload.addHandler(() => Promise.resolve(addOn.onunload()).then(() => true));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an add-on by its class name. Returns undefined if not found.
|
||||
* @param cls
|
||||
* @returns
|
||||
*/
|
||||
getAddOn<T extends TCommands>(cls: string) {
|
||||
for (const addon of this.addOns) {
|
||||
if (addon.constructor.name == cls) return addon as T;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
constructor(
|
||||
serviceHub: InjectableServiceHub<T>,
|
||||
serviceModuleInitialiser: (
|
||||
@@ -304,5 +292,4 @@ export class LiveSyncBaseCore<
|
||||
export interface IMinimumLiveSyncCommands {
|
||||
onunload(): void;
|
||||
onload(): void | Promise<void>;
|
||||
constructor: { name: string };
|
||||
}
|
||||
Reference in new issue
Block a user