Skip to content

Commit

Permalink
fix initial_value for computed_var (#3726)
Browse files Browse the repository at this point in the history
* fix initial_value for computed_var

* fix initial_value in pyi
  • Loading branch information
benedikt-bartscher authored Jul 31, 2024
1 parent 1c40004 commit 2629366
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion reflex/vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -2482,7 +2482,7 @@ def _determine_var_type(self) -> Type:

def computed_var(
fget: Callable[[BaseState], Any] | None = None,
initial_value: Any | None = None,
initial_value: Any | types.Unset = types.Unset(),
cache: bool = False,
deps: Optional[List[Union[str, Var]]] = None,
auto_deps: bool = True,
Expand Down
4 changes: 2 additions & 2 deletions reflex/vars.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class ComputedVar(Var):
@overload
def computed_var(
fget: Callable[[BaseState], Any] | None = None,
initial_value: Any | None = None,
initial_value: Any | types.Unset = types.Unset(),
cache: bool = False,
deps: Optional[List[Union[str, Var]]] = None,
auto_deps: bool = True,
Expand All @@ -202,7 +202,7 @@ def computed_var(fget: Callable[[Any], Any]) -> ComputedVar: ...
@overload
def cached_var(
fget: Callable[[BaseState], Any] | None = None,
initial_value: Any | None = None,
initial_value: Any | types.Unset = types.Unset(),
deps: Optional[List[Union[str, Var]]] = None,
auto_deps: bool = True,
interval: Optional[Union[datetime.timedelta, int]] = None,
Expand Down

0 comments on commit 2629366

Please sign in to comment.