Skip to content

Commit

Permalink
Delete Reactive.var.
Browse files Browse the repository at this point in the history
Related issues: #2706.
  • Loading branch information
rodrigogiraoserrao committed May 31, 2023
1 parent 7049014 commit 8516dda
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- `Placeholder.reset_color_cycle`
- Removed `Widget.reset_focus` (now called `Widget.blur`) https://github.com/Textualize/textual/issues/2642

- Removed `reactive.py::Reactive.var` in favor of `reactive.py::var` https://github.com/Textualize/textual/pull/2709/

## [0.26.0] - 2023-05-20

Expand Down
17 changes: 0 additions & 17 deletions src/textual/reactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,6 @@ def __rich_repr__(self) -> rich.repr.Result:
yield "always_update", self._always_update
yield "compute", self._run_compute

@classmethod
def var(
cls,
default: ReactiveType | Callable[[], ReactiveType],
always_update: bool = False,
) -> Reactive:
"""A reactive variable that doesn't update or layout.
Args:
default: A default value or callable that returns a default.
always_update: Call watchers even when the new value equals the old value.
Returns:
A Reactive descriptor.
"""
return cls(default, layout=False, repaint=False, init=False)

def _initialize_reactive(self, obj: Reactable, name: str) -> None:
"""Initialized a reactive attribute on an object.
Expand Down

0 comments on commit 8516dda

Please sign in to comment.