Skip to content

Commit

Permalink
Merge pull request #2709 from Textualize/delete-reactive-var
Browse files Browse the repository at this point in the history
Delete Reactive.var.
  • Loading branch information
rodrigogiraoserrao authored Jun 6, 2023
2 parents 755da5e + 0c26f62 commit f0871ad
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 @@ -56,13 +56,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Keybinding <kbd>right</kbd> in `Input` is also used to accept a suggestion if the cursor is at the end of the input https://github.com/Textualize/textual/pull/2604
- `Input.__init__` now accepts a `suggester` attribute for completion suggestions https://github.com/Textualize/textual/pull/2604
- Using `switch_screen` to switch to the currently active screen is now a no-op https://github.com/Textualize/textual/pull/2692
- Breaking change: removed `reactive.py::Reactive.var` in favor of `reactive.py::var` https://github.com/Textualize/textual/pull/2709/

### Removed

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


## [0.26.0] - 2023-05-20

### Added
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 f0871ad

Please sign in to comment.