You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several places in my app depend on the number of entities.
Could be 0, 1 or more than 1.
I would like to get the count only from live query.
Example: Im saving the count of the users the user added under her organization in the global state when loading the app. But this can change any time she will add/delete a user. I would like to app to reflect that without rerunning await remult.repo(User).count()
or
useEffect(() => {
return remult.repo(User)
.liveQuery(
.count()
.subscribe(info => setTasks(info.applyChanges))
}, [])
Both of these will return the item count only.
The text was updated successfully, but these errors were encountered:
Several places in my app depend on the number of entities.
Could be 0, 1 or more than 1.
I would like to get the count only from live query.
Example: Im saving the count of the users the user added under her organization in the global state when loading the app. But this can change any time she will add/delete a user. I would like to app to reflect that without rerunning
await remult.repo(User).count()
A solution like:
or
useEffect(() => {
return remult.repo(User)
.liveQuery(
.count()
.subscribe(info => setTasks(info.applyChanges))
}, [])
Both of these will return the item count only.
The text was updated successfully, but these errors were encountered: