Skip to content

Commit

Permalink
Fix promise/observable discrimination
Browse files Browse the repository at this point in the history
  • Loading branch information
josepjaume committed Mar 4, 2025
1 parent a52cdb9 commit 384e7c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/experimental/Collections/useData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export function useData<
const result = fetcher()

// Handle synchronous data
if (!(result instanceof Promise || result instanceof Observable)) {
if (!("then" in result || "subscribe" in result)) {
handleFetchSuccess(result)
return
}
Expand Down

0 comments on commit 384e7c6

Please sign in to comment.