Skip to content

Commit

Permalink
Fix previous promise checking
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospassos committed Jun 10, 2021
1 parent b212bfd commit 4e0f86a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function useLoader<R>({initial, ...options}: CacheOptions<R>): R {
try {
setValue(cache.load(options));
} catch (result) {
if (result?.then !== 'function') {
if (typeof result?.then !== 'function') {
setValue(undefined);

return;
Expand Down

0 comments on commit 4e0f86a

Please sign in to comment.