From 25ecb1cb75b7b5b584ad223e12d74c3e3ee7da89 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 12 Feb 2023 13:05:25 +0100 Subject: Add textual search on title, subtitle and authors --- src/lib/functions.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/lib/functions.ts (limited to 'src/lib/functions.ts') diff --git a/src/lib/functions.ts b/src/lib/functions.ts new file mode 100644 index 0000000..0ec9f00 --- /dev/null +++ b/src/lib/functions.ts @@ -0,0 +1,7 @@ +export function debounce(func: Function, timeout: number) { + let timer: any + return (...args: any) => { + clearTimeout(timer) + timer = setTimeout(() => { func.apply(this, args) }, timeout) + } +} -- cgit v1.2.3