mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-11-03 06:48:18 +00:00
Adopt refined shared runtime API names
This commit is contained in:
1 parent
bd05dde39c
commit
312cbac933
3 files changed
+14
-14
No files matched your search
@@ -54,10 +54,10 @@ vi.mock("@/common/obsidianCommunityPlugins.ts", () => ({
|
||||
getObsidianCommunityPluginManager: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("octagonal-wheels/concurrency/scopedIteration", { spy: true });
|
||||
vi.mock("octagonal-wheels/concurrency/scoped.iteration", { spy: true });
|
||||
|
||||
import { LOG_LEVEL_VERBOSE, type FilePath } from "@vrtmrz/livesync-commonlib/compat/common/types";
|
||||
import * as iterationModule from "octagonal-wheels/concurrency/scopedIteration";
|
||||
import * as iterationModule from "octagonal-wheels/concurrency/scoped.iteration";
|
||||
import { promiseWithResolvers } from "octagonal-wheels/promises";
|
||||
import { ConfigSync } from "./CmdConfigSync";
|
||||
|
||||
@@ -262,8 +262,8 @@ describe("ConfigSync scoped iteration composition", () => {
|
||||
it.each(["database", "extra"])("propagates a %s runner failure outside per-item recovery", async (batch) => {
|
||||
const fixture = setup(["extra"], [row("stale")]);
|
||||
const error = new Error("iteration");
|
||||
const actual = await vi.importActual<typeof import("octagonal-wheels/concurrency/scopedIteration")>(
|
||||
"octagonal-wheels/concurrency/scopedIteration"
|
||||
const actual = await vi.importActual<typeof import("octagonal-wheels/concurrency/scoped.iteration")>(
|
||||
"octagonal-wheels/concurrency/scoped.iteration"
|
||||
);
|
||||
if (batch === "extra") {
|
||||
vi.mocked(iterationModule.forEachInScope).mockImplementationOnce(actual.forEachInScope);
|
||||
|
||||
@@ -59,7 +59,7 @@ import { QueueProcessor } from "octagonal-wheels/concurrency/processor";
|
||||
import { pluginScanningCount } from "@vrtmrz/livesync-commonlib/compat/mock_and_interop/stores";
|
||||
import { base64ToArrayBuffer, base64ToString } from "octagonal-wheels/binary/base64";
|
||||
import { ConflictResolveModal } from "@/modules/features/InteractiveConflictResolving/ConflictResolveModal.ts";
|
||||
import { forEachInScope } from "octagonal-wheels/concurrency/scopedIteration";
|
||||
import { forEachInScope } from "octagonal-wheels/concurrency/scoped.iteration";
|
||||
import { withScope } from "octagonal-wheels/resource/scope";
|
||||
import { EVENT_REQUEST_OPEN_PLUGIN_SYNC_DIALOG, eventHub } from "@/common/events.ts";
|
||||
import { PluginDialogModal } from "./PluginDialogModal.ts";
|
||||
@@ -69,7 +69,7 @@ import type { LiveSyncCore } from "@/main.ts";
|
||||
import { LiveSyncError } from "@vrtmrz/livesync-commonlib/compat/common/LSError";
|
||||
import type { OptionalSyncFeatureMode } from "@/features/optionalSyncFeatures.ts";
|
||||
import { getObsidianCommunityPluginManager } from "@/common/obsidianCommunityPlugins.ts";
|
||||
import { createContentApplier } from "octagonal-wheels/content";
|
||||
import { createModificationHandler } from "octagonal-wheels/modification";
|
||||
|
||||
import type { HandlerOutcome } from "@vrtmrz/livesync-commonlib/compat/services/lib/HandlerUtils";
|
||||
import type { OptionalFileEventOptions } from "@vrtmrz/livesync-commonlib/compat/services/base/IService";
|
||||
@@ -1033,7 +1033,7 @@ export class ConfigSync extends LiveSyncCommands {
|
||||
await this.storeCustomisationFileV2(path, this.services.setting.getDeviceAndVaultName());
|
||||
} else {
|
||||
const files = data.files;
|
||||
const applyBinaryContent = createContentApplier<
|
||||
const applyBinaryContent = createModificationHandler<
|
||||
ConfigFileApplicationTarget,
|
||||
LoadedEntryPluginDataExFile,
|
||||
ArrayBuffer,
|
||||
@@ -1050,7 +1050,7 @@ export class ConfigSync extends LiveSyncCommands {
|
||||
write: (target, content) =>
|
||||
this.core.storageAccess.writeHiddenFileAuto(target.path, content, target.stat),
|
||||
});
|
||||
const applyTextContent = createContentApplier<
|
||||
const applyTextContent = createModificationHandler<
|
||||
ConfigFileApplicationTarget,
|
||||
LoadedEntryPluginDataExFile,
|
||||
string,
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
} from "./settingConstants.ts";
|
||||
import { $msg } from "@/common/translation";
|
||||
import type { AutoWireOption, OnUpdateResult } from "./SettingPane.ts";
|
||||
import { wrapMemo } from "octagonal-wheels/function";
|
||||
import { onlyWhenChanged } from "octagonal-wheels/function";
|
||||
import { setButtonDestructiveState } from "./settingComponentStyles.ts";
|
||||
|
||||
export class LiveSyncSetting extends Setting {
|
||||
@@ -118,7 +118,7 @@ export class LiveSyncSetting extends Setting {
|
||||
const conf = this.autoWireSetting(key, opt);
|
||||
addComponent((text) => {
|
||||
this.autoWiredComponent = text;
|
||||
const setValue = wrapMemo((value: string) => {
|
||||
const setValue = onlyWhenChanged((value: string) => {
|
||||
text.setValue(value);
|
||||
});
|
||||
this.invalidateValue = () => setValue(`${LiveSyncSetting.env.editingSettings[key]}`);
|
||||
@@ -167,7 +167,7 @@ export class LiveSyncSetting extends Setting {
|
||||
text.inputEl.setAttribute("max", `${opt.clampMax}`);
|
||||
}
|
||||
let lastError = false;
|
||||
const setValue = wrapMemo((value: string) => {
|
||||
const setValue = onlyWhenChanged((value: string) => {
|
||||
text.setValue(value);
|
||||
});
|
||||
this.invalidateValue = () => {
|
||||
@@ -213,7 +213,7 @@ export class LiveSyncSetting extends Setting {
|
||||
const conf = this.autoWireSetting(key, opt);
|
||||
this.addToggle((toggle) => {
|
||||
this.autoWiredComponent = toggle;
|
||||
const setValue = wrapMemo((value: boolean) => {
|
||||
const setValue = onlyWhenChanged((value: boolean) => {
|
||||
toggle.setValue(opt?.invert ? !value : value);
|
||||
});
|
||||
this.invalidateValue = () =>
|
||||
@@ -232,7 +232,7 @@ export class LiveSyncSetting extends Setting {
|
||||
const conf = this.autoWireSetting(key, opt);
|
||||
this.addDropdown((dropdown) => {
|
||||
this.autoWiredComponent = dropdown;
|
||||
const setValue = wrapMemo((value: string) => {
|
||||
const setValue = onlyWhenChanged((value: string) => {
|
||||
dropdown.setValue(value);
|
||||
});
|
||||
|
||||
@@ -252,7 +252,7 @@ export class LiveSyncSetting extends Setting {
|
||||
const conf = this.autoWireSetting(key, opt);
|
||||
this.addDropdown((dropdown) => {
|
||||
this.autoWiredComponent = dropdown;
|
||||
const setValue = wrapMemo((value: string) => {
|
||||
const setValue = onlyWhenChanged((value: string) => {
|
||||
dropdown.setValue(value);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user