Skip to content

Commit 0f946d5

Browse files
update package.json (#50)
* update package.json * update package.json
1 parent 421e044 commit 0f946d5

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

docs/utils-reference/getting-started.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ npm install --save @raycast/utils
1616

1717
## Changelog
1818

19+
### v2.0.1
20+
21+
- Fix types for ESM extensions
22+
1923
### v2.0.0
2024

2125
- The library can now be tree-shaken, reducing its size considerably.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@raycast/utils",
3-
"version": "1.19.1",
3+
"version": "2.0.1",
44
"description": "Set of utilities to streamline building Raycast extensions",
55
"author": "Raycast Technologies Ltd.",
66
"homepage": "https://developers.raycast.com/utils-reference",

src/usePromise.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export function usePromise<T extends FunctionReturningPromise | FunctionReturnin
168168
latestAbortable.current.current = new AbortController();
169169
}
170170
return ++lastCallId.current;
171-
}, []);
171+
}, [latestAbortable]);
172172

173173
const callback = useCallback(
174174
(...args: Parameters<T>): Promise<UnwrapReturn<T>> => {
@@ -261,7 +261,6 @@ export function usePromise<T extends FunctionReturningPromise | FunctionReturnin
261261
}, handleError) as Promise<UnwrapReturn<T>>;
262262
},
263263
[
264-
latestAbortable,
265264
latestOnData,
266265
latestOnError,
267266
latestArgs,
@@ -271,6 +270,7 @@ export function usePromise<T extends FunctionReturningPromise | FunctionReturnin
271270
latestOnWillExecute,
272271
paginationArgsRef,
273272
latestFailureToast,
273+
abort,
274274
],
275275
);
276276

@@ -321,7 +321,7 @@ export function usePromise<T extends FunctionReturningPromise | FunctionReturnin
321321
}
322322
}
323323
},
324-
[revalidate, latestValue, set],
324+
[revalidate, latestValue, set, abort],
325325
);
326326

327327
const onLoadMore = useCallback(() => {
@@ -349,7 +349,7 @@ export function usePromise<T extends FunctionReturningPromise | FunctionReturnin
349349
return () => {
350350
abort();
351351
};
352-
}, []);
352+
}, [abort]);
353353

354354
// we only want to show the loading indicator if the promise is executing
355355
const isLoading = options?.execute !== false ? state.isLoading : false;

0 commit comments

Comments
 (0)