Skip to content

Commit

Permalink
fix: use perfect-debounce (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Mar 29, 2022
1 parent d13b842 commit 5642e0d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
"object-hash": "^3.0.0",
"ohmyfetch": "^0.4.15",
"ora": "^6.1.0",
"p-debounce": "^4.0.0",
"pathe": "^0.2.0",
"perfect-debounce": "^0.1.3",
"pkg-types": "^0.3.2",
"pretty-bytes": "^6.0.0",
"rollup": "^2.70.1",
Expand Down
4 changes: 2 additions & 2 deletions src/server/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Worker } from 'worker_threads'
import { IncomingMessage, ServerResponse } from 'http'
import { existsSync, promises as fsp } from 'fs'
import chokidar, { FSWatcher } from 'chokidar'
import debounce from 'p-debounce'
import { debounce } from 'perfect-debounce'
import { promisifyHandle, createApp, Middleware, useBase } from 'h3'
import httpProxy from 'http-proxy'
import { listen, Listener, ListenOptions } from 'listhen'
Expand Down Expand Up @@ -73,7 +73,7 @@ export function createDevServer (nitro: Nitro) {
// Replace new worker as current
currentWorker = newWorker
}
const reload = debounce(() => _reload().catch(console.warn), 200, { before: true })
const reload = debounce(() => _reload().catch(console.warn))
nitro.hooks.hook('nitro:dev:reload', reload)

// App
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5121,8 +5121,8 @@ __metadata:
object-hash: ^3.0.0
ohmyfetch: ^0.4.15
ora: ^6.1.0
p-debounce: ^4.0.0
pathe: ^0.2.0
perfect-debounce: ^0.1.3
pkg-types: ^0.3.2
pretty-bytes: ^6.0.0
rollup: ^2.70.1
Expand Down Expand Up @@ -5539,13 +5539,6 @@ __metadata:
languageName: node
linkType: hard

"p-debounce@npm:^4.0.0":
version: 4.0.0
resolution: "p-debounce@npm:4.0.0"
checksum: 7f796f6ed264cb964b83601e70c4c0d94dd52d54e1361400ee80df7527217a59074aa14ab746d4d3089b352181c4ffb5329158fd679cb4b4b52c208574e9e56d
languageName: node
linkType: hard

"p-limit@npm:^1.1.0":
version: 1.3.0
resolution: "p-limit@npm:1.3.0"
Expand Down Expand Up @@ -5721,6 +5714,13 @@ __metadata:
languageName: node
linkType: hard

"perfect-debounce@npm:^0.1.3":
version: 0.1.3
resolution: "perfect-debounce@npm:0.1.3"
checksum: c77465eb23d87669e5ee646d12331507c45278e0f2e6fc20a587104b956c1a53f9afe723915d882f73fa588e42770a2edd2bbd93eb0b958c9ff1eb7b915ccdc1
languageName: node
linkType: hard

"picocolors@npm:^1.0.0":
version: 1.0.0
resolution: "picocolors@npm:1.0.0"
Expand Down

0 comments on commit 5642e0d

Please sign in to comment.