mirror of
https://github.com/tazihad/obsidian-easy-keep-view.git
synced 2026-07-22 05:49:04 +00:00
using obsidian debounce
This commit is contained in:
parent
0077135863
commit
70d81c7c18
1 changed files with 1 additions and 11 deletions
12
src/main.ts
12
src/main.ts
|
|
@ -1,6 +1,5 @@
|
|||
import { App, Plugin, WorkspaceLeaf, ItemView, TFile } from "obsidian";
|
||||
import { App, Plugin, WorkspaceLeaf, ItemView, TFile, debounce } from "obsidian";
|
||||
import { DEFAULT_SETTINGS, EasySettingTab, NoteEntry, EasyKeepViewPluginSettings } from "./settings"; // Import from settings
|
||||
|
||||
const VIEW_TYPE_EASY_KEEP = "easy-keep-view";
|
||||
|
||||
// Helper function to resolve image by name
|
||||
|
|
@ -15,15 +14,6 @@ function resolveImageByName(app: App, imageName: string): TFile | null {
|
|||
return null;
|
||||
}
|
||||
|
||||
// Debounce function for throttling updates
|
||||
function debounce(fn: (...args: any[]) => void, delay = 300): (...args: any[]) => void {
|
||||
let timer: NodeJS.Timeout;
|
||||
return (...args: any[]) => {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => fn(...args), delay);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
class EasyKeepView extends ItemView {
|
||||
|
|
|
|||
Loading…
Reference in a new issue