Skip to content

Commit

Permalink
Merge pull request #12 from ar90n/feature/fix-simple-counter-example
Browse files Browse the repository at this point in the history
fix: Fix simple counter example
  • Loading branch information
ar90n authored Apr 30, 2022
2 parents e141ff8 + be60fdc commit 85a04ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/simple_counter/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass
from typing import TypeAlias, Union
from typing import TypeAlias

from alfort import Effect
from alfort.vdom import VDom, el
Expand All @@ -17,7 +17,7 @@ class CountDown:
value: int = 1


Msg: TypeAlias = Union[CountUp, CountDown]
Msg: TypeAlias = CountUp | CountDown


def title(text: str) -> VDom:
Expand Down Expand Up @@ -58,7 +58,7 @@ def view(state: dict[str, int]) -> VDom:


def init() -> tuple[dict[str, int], list[Effect[Msg]]]:
return ({"count": 0, "auto_inc": False}, [])
return ({"count": 0}, [])


def update(msg: Msg, state: dict[str, int]) -> tuple[dict[str, int], list[Effect[Msg]]]:
Expand Down

0 comments on commit 85a04ac

Please sign in to comment.