hmr 0.6.0.1__tar.gz → 0.6.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hmr-0.6.0.1 → hmr-0.6.0.2}/PKG-INFO +1 -1
- {hmr-0.6.0.1 → hmr-0.6.0.2}/pyproject.toml +1 -1
- {hmr-0.6.0.1 → hmr-0.6.0.2}/reactivity/context.py +9 -0
- {hmr-0.6.0.1 → hmr-0.6.0.2}/reactivity/hmr/core.py +1 -1
- {hmr-0.6.0.1 → hmr-0.6.0.2}/reactivity/primitives.py +3 -2
- {hmr-0.6.0.1 → hmr-0.6.0.2}/README.md +0 -0
- {hmr-0.6.0.1 → hmr-0.6.0.2}/reactivity/__init__.py +0 -0
- {hmr-0.6.0.1 → hmr-0.6.0.2}/reactivity/functional.py +0 -0
- {hmr-0.6.0.1 → hmr-0.6.0.2}/reactivity/helpers.py +0 -0
- {hmr-0.6.0.1 → hmr-0.6.0.2}/reactivity/hmr/__init__.py +0 -0
- {hmr-0.6.0.1 → hmr-0.6.0.2}/reactivity/hmr/__main__.py +0 -0
- {hmr-0.6.0.1 → hmr-0.6.0.2}/reactivity/hmr/api.py +0 -0
- {hmr-0.6.0.1 → hmr-0.6.0.2}/reactivity/hmr/hooks.py +0 -0
- {hmr-0.6.0.1 → hmr-0.6.0.2}/reactivity/hmr/utils.py +0 -0
@@ -38,6 +38,15 @@ class Context(NamedTuple):
|
|
38
38
|
def effect(self):
|
39
39
|
return partial(Effect, context=self)
|
40
40
|
|
41
|
+
@contextmanager
|
42
|
+
def untrack(self):
|
43
|
+
computations = self.current_computations[:]
|
44
|
+
self.current_computations.clear()
|
45
|
+
try:
|
46
|
+
yield
|
47
|
+
finally:
|
48
|
+
self.current_computations[:] = computations
|
49
|
+
|
41
50
|
|
42
51
|
def new_context():
|
43
52
|
return Context([], [])
|
@@ -34,8 +34,9 @@ class Subscribable:
|
|
34
34
|
return
|
35
35
|
last = self.context.current_computations[-1]
|
36
36
|
if last is not self:
|
37
|
-
self.
|
38
|
-
|
37
|
+
with self.context.untrack():
|
38
|
+
self.subscribers.add(last)
|
39
|
+
last.dependencies.add(self)
|
39
40
|
|
40
41
|
def notify(self):
|
41
42
|
if self.context.batches:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|