Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dustingetz committed Aug 5, 2022
1 parent f8cd63b commit 9d1499c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Hyperfiddle Photon – a streaming Clojure/Script dialect with compiler-managed client/server datasync
# Hyperfiddle Photon – a multi-tier Clojure/Script dialect for fullstack web apps with managed server data-fetching

Photon lets you express a frontend/backend web application as a single unified Clojure/Script expression that transcends the client/server boundary.

```clojure
(p/defn View [db state]
(p/defn Teeshirt-orders [db]
(p/client
(dom/div
(let [email (dom/input)]
(dom/h1 "Your orders")
(let [!email (atom "") email (p/watch !email)]
(ui/input {::ui/input-event (p/fn [e] (reset! !email (:value dom/node)))})
(dom/h1 "Your tee-shirt orders")
(dom/table
(p/for [x (p/server xs (query-database db email))]
(dom/tr (pr-str x))))))))

; Note: This is our target future syntax, we're not quite there yet.
(p/server
(p/for [x (query-teeshirt-orders db email)]
(p/client (dom/tr (pr-str x))))))))))
```

It's called Photon because every point in a Photon form can be thought of as simultaneously a reactive flow and a value.
Expand Down

0 comments on commit 9d1499c

Please sign in to comment.