Skip to content

Commit

Permalink
fix: publish debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
icidasset committed Dec 21, 2023
1 parent 48ff3d4 commit a3b6038
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/nest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@
"dependencies": {
"@ipld/dag-pb": "^4.0.6",
"compare-versions": "^6.1.0",
"debounce": "^2.0.0",
"emittery": "^1.0.1",
"interface-blockstore": "^5.2.7",
"ipfs-unixfs": "^11.1.0",
"ipfs-unixfs-exporter": "^13.2.2",
"ipfs-unixfs-importer": "^15.2.1",
"it-all": "^3.0.4",
"multiformats": "^12.1.3",
"p-debounce": "^4.0.0",
"uint8arrays": "^5.0.0",
"wnfs": "0.1.27"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/nest/src/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { PrivateForest, PublicDirectory, PublicFile } from 'wnfs'
import { CID } from 'multiformats/cid'
import { AccessKey, PrivateDirectory, PrivateFile, PrivateNode } from 'wnfs'

import debounce from 'debounce'
import debounce from 'p-debounce'
import Emittery, {
type EmitteryOncePromise,
type OmnipresentEventData,
Expand Down Expand Up @@ -64,7 +64,7 @@ export interface FileSystemOptions {
/** @group 🪺 :: START HERE */
export class FileSystem {
readonly #blockstore: Blockstore
readonly #debouncedDataRootUpdate: debounce.DebouncedFunction<any>
readonly #debouncedDataRootUpdate: (...dataRoots: CID[]) => Promise<void>
readonly #eventEmitter: Emittery<Events>
readonly #onCommit: CommitVerifier
readonly #rng: Rng.Rng
Expand Down Expand Up @@ -797,6 +797,6 @@ export class FileSystem {
// ㊙️ ▒▒ PUBLISHING

async #publish(dataRoot: CID): Promise<void> {
await this.#debouncedDataRootUpdate(dataRoot)
this.#debouncedDataRootUpdate(dataRoot)
}
}
2 changes: 0 additions & 2 deletions packages/nest/test/class.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,9 +926,7 @@ describe('File System Class', () => {
})

await fs.write(Path.file('private', 'a'), 'bytes', new Uint8Array())

await fs.write(Path.file('private', 'b'), 'bytes', new Uint8Array())

await fs.write(Path.file('private', 'c'), 'bytes', new Uint8Array())

const d = await fs.write(
Expand Down
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a3b6038

Please sign in to comment.