Skip to content

Commit

Permalink
simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsJPeschel committed Jan 9, 2025
1 parent c69bc39 commit 321caef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions hooks/useLoadData/useLoadData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ function unboxApiResponse<T>(arg: ApiResponse<T> | T): T {
native promise (preferred) or whether it has a then method.
*/
function isPromise<T>(promisable: Promisable<T>): promisable is Promise<T> {
return (
promisable instanceof Promise ||
(promisable && typeof promisable === 'object' && 'then' in promisable && typeof promisable.then === 'function')
);
return promisable && typeof promisable === 'object' && 'then' in promisable && typeof promisable.then === 'function';
}

export interface LoadDataConfig {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@optum/react-hooks",
"version": "1.0.4",
"version": "1.0.5-next.1",
"description": "A reusable set of React hooks",
"repository": "https://github.com/Optum/react-hooks",
"license": "Apache 2.0",
Expand Down

0 comments on commit 321caef

Please sign in to comment.