Skip to content

Commit 386be64

Browse files
Ensure no callback is triggered when watchers are destroyed (#124)
* Ensure no callback is triggered when watchers are destroyed * Bump version
1 parent 64d7346 commit 386be64

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

collagraph/fragment.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,19 +317,21 @@ def unmount(self, destroy=True):
317317
self.target = None
318318
self._attributes = {}
319319
self._events = {}
320-
# Disable the fn of the watcher to disable
321-
# any 'false' hits
320+
# Disable the fn and callback of the watcher to disable
321+
# any 'false' triggers
322322
for watcher in self._watchers.values():
323323
watcher.fn = lambda: ()
324+
watcher.callback = None
324325
self._watchers = {}
325326
self._condition = None
326327
self.tag = None
327328
else:
328329
self.element = None
329-
# Disable the fn of the watcher to disable
330-
# any 'false' hits
330+
# Disable the fn and callback of the watcher to disable
331+
# any 'false' triggers
331332
for watcher in self._watchers.values():
332333
watcher.fn = lambda: ()
334+
watcher.callback = None
333335
self._watchers = {}
334336

335337
# TODO: maybe control flow fragments needs another custom 'parenting'

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "collagraph"
3-
version = "0.8.1"
3+
version = "0.8.2"
44
description = "Reactive user interfaces"
55
authors = [
66
{ name = "Berend Klein Haneveld", email = "berendkleinhaneveld@gmail.com" },

0 commit comments

Comments
 (0)