diff --git a/plugins/fs-watch/README.md b/plugins/fs-watch/README.md index 8162d1fe..59729b4d 100644 --- a/plugins/fs-watch/README.md +++ b/plugins/fs-watch/README.md @@ -56,18 +56,18 @@ import { watch, watchImmediate } from "tauri-plugin-fs-watch-api"; // can also watch an array of paths const stopWatching = await watch( "/path/to/something", - { recursive: true }, (event) => { const { type, payload } = event; - } + }, + { recursive: true } ); const stopRawWatcher = await watchImmediate( ["/path/a", "/path/b"], - {}, (event) => { const { path, operation, cookie } = event; - } + }, + {} ); ``` diff --git a/plugins/fs-watch/guest-js/index.ts b/plugins/fs-watch/guest-js/index.ts index 31d333b2..05ed07e5 100644 --- a/plugins/fs-watch/guest-js/index.ts +++ b/plugins/fs-watch/guest-js/index.ts @@ -44,8 +44,8 @@ async function unwatch(id: number): Promise { export async function watch( paths: string | string[], - options: DebouncedWatchOptions, - cb: (event: DebouncedEvent) => void + cb: (event: DebouncedEvent) => void, + options: DebouncedWatchOptions = {} ): Promise { const opts = { recursive: false, @@ -82,8 +82,8 @@ export async function watch( export async function watchImmediate( paths: string | string[], - options: WatchOptions, - cb: (event: RawEvent) => void + cb: (event: RawEvent) => void, + options: WatchOptions = {} ): Promise { const opts = { recursive: false,