From 3ba0128023b872b51448741b0a989f71f63ed658 Mon Sep 17 00:00:00 2001 From: Jakub Chodorowicz Date: Sun, 14 Nov 2021 12:01:51 +0100 Subject: [PATCH] Fix formatting Signed-off-by: Jakub Chodorowicz --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 76c7bf9..4a2d765 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,12 @@ [![npm type definitions](https://img.shields.io/npm/types/ts-debounce.svg)](https://www.npmjs.com/package/ts-debounce) + [![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-) -_Debounce_ creates a new function `g`, which when called will delay the invocation of the original function `f` until `n` milliseconds, BUT drop previous pending delayed emissions if a new invocation is made before `n` milliseconds. + + + +_Debounce_ creates a new function `g`, which when called will delay the invocation of the original function `f` until `n` milliseconds, BUT drop previous pending delayed emissions if a new invocation is made before `n` milliseconds. It's very useful for scenarios when it's better to limit the number of times the function is called. E.g. think of search input which fetches data from API. It's enough display search results after user has stopped entering characters for some time.