aboutsummaryrefslogtreecommitdiff
path: root/examples/ui.sloth
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2023-06-26 23:53:44 -0500
committerCody <cody@codyq.dev>2023-06-26 23:53:44 -0500
commit9748e95027af7820e6d9f08eb20b0901fdedfa2a (patch)
tree248fd1952537edc9e107110a6dc5a432c676d021 /examples/ui.sloth
parent27b7187c21f6ff4e469592a8ea5757ca6aee8577 (diff)
downloadsloth-9748e95027af7820e6d9f08eb20b0901fdedfa2a.tar.gz
Delete random examples
Diffstat (limited to 'examples/ui.sloth')
-rw-r--r--examples/ui.sloth56
1 files changed, 0 insertions, 56 deletions
diff --git a/examples/ui.sloth b/examples/ui.sloth
deleted file mode 100644
index 2f69825..0000000
--- a/examples/ui.sloth
+++ /dev/null
@@ -1,56 +0,0 @@
-use extern "ui"
-
-use ui::components::Button;
-use ui::components::Label;
-use ui::components::FlexView;
-
-type Action =
- | Increment
- | Decrement
-
-fn update(state, message) {
- match message {
- Action::Increment -> state + 1,
- Action::Decrement -> state - 1,
- }
-}
-
-fn render(state, dispatch) {
- return FlexView([
- Button("-", action: -> dispatch(Action::Decrement)),
- Label(state),
- Button("+", action: -> dispatch(Action::Increment)),
-
- FlexView(
- height: 500,
- width: 220,
- body: [
- Label("List 1"),
- Label("List 2"),
- Label("List 3"),
- ],
- )
-
- Button(
- width: 100,
- height: 20,
- action: -> (),
- body: Label("Sign up"),
- )
- ])
-}
-
-fn app() {
- # Creating our state
- val state = 0
-
- # Creating our app
- val app = ui::App(
- state,
- on_update: update,
- on_render: render,
- )
-
- # Starting our app
- app.start()
-}