diff --git a/hooks/useLoadData/callbacks/complete/complete.ts b/hooks/useLoadData/callbacks/complete/complete.ts index cd3524e..7435730 100644 --- a/hooks/useLoadData/callbacks/complete/complete.ts +++ b/hooks/useLoadData/callbacks/complete/complete.ts @@ -2,7 +2,7 @@ export function complete(onSuccess?: (data: T) => void, onError?: (error: unk return (err?: unknown, res?: T) => { if (err) { onError?.(err); - } else if (res) { + } else if (res || res === null) { onSuccess?.(res); } }; diff --git a/hooks/useLoadData/callbacks/success/success.ts b/hooks/useLoadData/callbacks/success/success.ts index 72aecff..ae4e297 100644 --- a/hooks/useLoadData/callbacks/success/success.ts +++ b/hooks/useLoadData/callbacks/success/success.ts @@ -1,6 +1,6 @@ export function success(onSuccess?: (data: T) => void) { return (err?: unknown, res?: T) => { - if (res) { + if (res || res === null) { onSuccess?.(res); } }; diff --git a/package.json b/package.json index 371629c..f0c8a3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@optum/react-hooks", - "version": "1.0.3", + "version": "1.0.3-next.1", "description": "A reusable set of React hooks", "repository": "https://github.com/Optum/react-hooks", "license": "Apache 2.0",