-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Description
- I've validated the bug against the latest version of DB packages
Describe the bug
When I return early in useLiveQuery as show in this example here, isReady is currently always false, I would expect it to be true.
const {
data: membership,
isLoading,
isReady,
} = useLiveQuery(
(q) => {
if (!user?.organizationId) return null
return q
.from({ member: organizationMemberCollection })
.innerJoin({ org: organizationCollection }, ({ member, org }) =>
eq(member.organizationId, org.id),
)
.where(({ member }) =>
and(eq(member.userId, user?.id), eq(member.organizationId, user?.organizationId)),
)
.findOne()
},
[user?.id, user?.organizationId],
)To Reproduce
Steps to reproduce the behavior:
- Define useLiveQuery with an early return
- Print isReady
Expected behavior
Should return true for isReady
Metadata
Metadata
Assignees
Labels
No labels