Right now, every time we type a query on your plugin we make a call to NPM's API.
That means that if I type "koa" we'll call "k", "ko", "koa" requests. Let's pretend I type "koac" with the "c" as typo then I delete the "c".This will make "k", "ko", "koa", "koac", "koa" requests. Two "koa" requests.
Memoization can reuse already loaded result. Currently I'm memoizing requests for one minute in my projects just so minor problems like the above one doesn't happen.
Debounce can prevent unwanted requests (like "k", "ko") while user is typing.
Right now, every time we type a query on your plugin we make a call to NPM's API.
That means that if I type "koa" we'll call "k", "ko", "koa" requests. Let's pretend I type "koac" with the "c" as typo then I delete the "c".This will make "k", "ko", "koa", "koac", "koa" requests. Two "koa" requests.
Memoization can reuse already loaded result. Currently I'm memoizing requests for one minute in my projects just so minor problems like the above one doesn't happen.
Debounce can prevent unwanted requests (like "k", "ko") while user is typing.
If you don't mind I can make a PR
p-debounce memoize example