hmr 0.6.1.2__tar.gz → 0.6.1.3__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.1.2 → hmr-0.6.1.3}/PKG-INFO +1 -1
- {hmr-0.6.1.2 → hmr-0.6.1.3}/pyproject.toml +1 -1
- {hmr-0.6.1.2 → hmr-0.6.1.3}/reactivity/hmr/core.py +1 -1
- {hmr-0.6.1.2 → hmr-0.6.1.3}/reactivity/hmr/utils.py +4 -6
- {hmr-0.6.1.2 → hmr-0.6.1.3}/README.md +0 -0
- {hmr-0.6.1.2 → hmr-0.6.1.3}/reactivity/__init__.py +0 -0
- {hmr-0.6.1.2 → hmr-0.6.1.3}/reactivity/context.py +0 -0
- {hmr-0.6.1.2 → hmr-0.6.1.3}/reactivity/functional.py +0 -0
- {hmr-0.6.1.2 → hmr-0.6.1.3}/reactivity/helpers.py +0 -0
- {hmr-0.6.1.2 → hmr-0.6.1.3}/reactivity/hmr/__init__.py +0 -0
- {hmr-0.6.1.2 → hmr-0.6.1.3}/reactivity/hmr/__main__.py +0 -0
- {hmr-0.6.1.2 → hmr-0.6.1.3}/reactivity/hmr/api.py +0 -0
- {hmr-0.6.1.2 → hmr-0.6.1.3}/reactivity/hmr/hooks.py +0 -0
- {hmr-0.6.1.2 → hmr-0.6.1.3}/reactivity/primitives.py +0 -0
@@ -5,8 +5,8 @@ from inspect import getsource, getsourcefile
|
|
5
5
|
from pathlib import Path
|
6
6
|
from types import FunctionType
|
7
7
|
|
8
|
-
from .. import
|
9
|
-
from .core import NamespaceProxy, ReactiveModule
|
8
|
+
from ..helpers import Memoized
|
9
|
+
from .core import HMR_CONTEXT, NamespaceProxy, ReactiveModule
|
10
10
|
from .hooks import post_reload, pre_reload
|
11
11
|
|
12
12
|
memos: dict[str, Callable] = {}
|
@@ -48,14 +48,12 @@ def cache_across_reloads[T](func: Callable[[], T]) -> Callable[[], T]:
|
|
48
48
|
if source in memos and source in functions_last:
|
49
49
|
return memos[source]
|
50
50
|
|
51
|
-
@wraps(func)
|
52
|
-
@create_memo
|
53
51
|
def wrapper() -> T:
|
54
52
|
return functions[source]()
|
55
53
|
|
56
|
-
memos[source] = wrapper
|
54
|
+
memos[source] = memo = Memoized(wrapper, context=HMR_CONTEXT)
|
57
55
|
|
58
|
-
return
|
56
|
+
return wraps(func)(memo)
|
59
57
|
|
60
58
|
|
61
59
|
class DictProxy(UserDict, dict): # type: ignore
|
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
|
File without changes
|