mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-28 16:42:04 +00:00
fix(nuxt): check if nuxt link observer is null (#30038)
This commit is contained in:
parent
a0dcb64c76
commit
1b0834facc
@ -506,9 +506,9 @@ function useObserver (): { observe: ObserveFn } | undefined {
|
|||||||
observer.observe(element)
|
observer.observe(element)
|
||||||
return () => {
|
return () => {
|
||||||
callbacks.delete(element)
|
callbacks.delete(element)
|
||||||
observer!.unobserve(element)
|
observer?.unobserve(element)
|
||||||
if (callbacks.size === 0) {
|
if (callbacks.size === 0) {
|
||||||
observer!.disconnect()
|
observer?.disconnect()
|
||||||
observer = null
|
observer = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user