Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix simple counter example #12

Merged
merged 1 commit into from
Apr 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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