From e59fbf53786acec4e5c8a9b573f6a1990d7832ec Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Sat, 14 Dec 2024 18:36:10 +0700 Subject: [PATCH] created --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c30318..1a8c4c7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,25 @@ -# damper.mjs +# Damper (debouncer, демпфер) +Execute multiple `function` calls in a `timeout` amount of time just once
+
+You may also know this technology as a "debouncer" (you are free to use any name)
+I prefer "damper", from the word "демпфер" + +## Example +```js +const dampered = damper( + ( + a, // 0 + b, // 1 + c, // 2 + force = false, // 3 + d, // 4 + resolve, + reject + ) => {}, + 500, + 3, // 3 -> the "force" argument +); + +dampered('for a', 'for b', 'for c', true, 'for d'); // Enabled forced execution + ``` \ No newline at end of file