Skip to content

Commit 944eb47

Browse files
committed
feat: remove extra clean-up.
1 parent 0a309f0 commit 944eb47

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

packages/solid-db/src/useLiveQuery.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,6 @@ export function useLiveQuery(
259259
// Update status ref whenever the effect runs
260260
setStatus(currentCollection.status)
261261

262-
// Clean up previous subscription
263-
if (currentUnsubscribe) {
264-
currentUnsubscribe()
265-
currentUnsubscribe = null
266-
}
267-
268262
// Initialize state with current collection data
269263
state.clear()
270264
for (const [key, value] of currentCollection.entries()) {
@@ -305,7 +299,7 @@ export function useLiveQuery(
305299
currentCollection.preload().catch(console.error)
306300
}
307301

308-
// Cleanup when effect is invalidated
302+
// Cleanup when computed is invalidated
309303
onCleanup(() => {
310304
if (currentUnsubscribe) {
311305
currentUnsubscribe()
@@ -317,14 +311,6 @@ export function useLiveQuery(
317311
{ name: `TanstackDBSyncComputed` }
318312
)
319313

320-
// Cleanup on unmount (only if we're in a component context)
321-
onCleanup(() => {
322-
if (currentUnsubscribe) {
323-
currentUnsubscribe()
324-
currentUnsubscribe = null
325-
}
326-
})
327-
328314
return {
329315
state,
330316
data,

0 commit comments

Comments
 (0)