python-library-reactive-model 0.1.1__tar.gz → 0.1.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.
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-library-reactive-model
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Requires-Python: >=3.10
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "python-library-reactive-model"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  requires-python = ">=3.10"
9
9
  dependencies = []
10
10
 
@@ -20,6 +20,13 @@ class ComputedModel(ReactiveModel[T]):
20
20
  self._cache: T | object = _MISSING
21
21
  self._deps: dict[int, tuple[Trackable, int]] = {}
22
22
 
23
+ def compute(self, expr: Callable[[], T]) -> None:
24
+ """
25
+ Args:
26
+ expr: The expression to compute the value.
27
+ """
28
+ self._expr = expr
29
+
23
30
  @property
24
31
  def value(self) -> T:
25
32
  if self._needs_recompute():