Skip to content

Commit

Permalink
Adjust types.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Nov 9, 2019
1 parent 6722e56 commit 7c9f854
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fsevents.d.ts
Expand Up @@ -24,7 +24,7 @@ declare type WatchHandler = (path: string, flags: number, id: string) => void;
export declare function watch(
path: string,
handler: WatchHandler,
): () => Promise<void> | null;
): () => Promise<void>;
export declare function getInfo(path: string, flags: number): Info;
export declare const constants: {
None: 0x00000000;
Expand Down
4 changes: 2 additions & 2 deletions fsevents.js
Expand Up @@ -25,8 +25,8 @@ function watch(path, handler) {
if (!instance) throw new Error(`could not watch: ${path}`);
return () => {
const result = instance
? Promise.resolve(instance).then(Native.stop).then(() => undefined)
: Promise.resolve(undefined);
? Promise.resolve(instance).then(Native.stop)
: Promise.resolve(undefined);
instance = undefined;
return result;
};
Expand Down

0 comments on commit 7c9f854

Please sign in to comment.