-
-
Save avocade/ae57bb93d46aba42ffe2d486ee3f67f7 to your computer and use it in GitHub Desktop.
Revisions
-
dustingetz revised this gist
Feb 16, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # TodoMVC Composed (it's just a for loop!!!) — Electric Clojure * An early demonstration "Compiler Managed Network" and the extreme dynamic composition it makes possible * TodoMVC Composed merely calls the [previous TodoMVC **function**](https://gist.github.com/dustingetz/2c1916766be8a61baa39f9f88feafc44#file-user-cljc-L128-L135) inside a for loop. https://user-images.githubusercontent.com/124158/186675049-c2e55723-455b-4892-a8ab-9d904698c198.mp4 -
dustingetz revised this gist
Feb 16, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # TodoMVC Composed (it's just a for loop!!!) — Electric Clojure * An early demonstration "Compiler Managed Network" and the extreme dynamic composition it makes possible * TodoMVC Composed merely calls the [previous TodoMVC *function*](https://gist.github.com/dustingetz/2c1916766be8a61baa39f9f88feafc44#file-user-cljc-L128-L135) inside a for loop. https://user-images.githubusercontent.com/124158/186675049-c2e55723-455b-4892-a8ab-9d904698c198.mp4 -
dustingetz revised this gist
Feb 16, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # TodoMVC Composed (it's just a for loop!!!) — Electric Clojure * An early demonstration "Compiler Managed Network" and the extreme dynamic composition it makes possible * TodoMVC Composed merely calls the [previous TodoMVC](https://gist.github.com/dustingetz/2c1916766be8a61baa39f9f88feafc44#file-user-cljc-L128-L135) *function* inside a for loop. https://user-images.githubusercontent.com/124158/186675049-c2e55723-455b-4892-a8ab-9d904698c198.mp4 -
dustingetz revised this gist
Feb 16, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # TodoMVC Composed (it's just a for loop!!!) — Electric Clojure * An early demonstration "Compiler Managed Network" and the extreme dynamic composition it makes possible * TodoMVC Composed merely calls the [previous TodoMVC](https://gist.github.com/dustingetz/2c1916766be8a61baa39f9f88feafc44) *function* inside a for loop. https://user-images.githubusercontent.com/124158/186675049-c2e55723-455b-4892-a8ab-9d904698c198.mp4 -
dustingetz revised this gist
Feb 16, 2023 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # TodoMVC Composed (it's just a for loop!!!) — Electric Clojure * An early demonstration "Compiler Managed Network" and the extreme dynamic composition it makes possible * TodoMVC Composed merely calls the previous TodoMVC *function* inside a for loop. https://user-images.githubusercontent.com/124158/186675049-c2e55723-455b-4892-a8ab-9d904698c198.mp4 -
dustingetz revised this gist
Feb 16, 2023 . 1 changed file with 31 additions and 30 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,34 +1,35 @@ (ns user.demo-todomvc-composed #?(:cljs (:require-macros user.demo-todomvc-composed)) (:require #?(:clj [datascript.core :as d]) [hyperfiddle.electric :as e] [hyperfiddle.electric-dom2 :as dom] [hyperfiddle.electric-ui4 :as ui] [user.demo-5-todomvc :as todomvc])) (def !n #?(:clj (atom 1))) (e/defn App [] (e/client (let [state (e/watch todomvc/!state) n (e/server (e/watch !n))] (e/server (binding [todomvc/db (e/watch todomvc/!conn) todomvc/transact! (partial d/transact! todomvc/!conn)] (e/client (dom/link (dom/props {:rel :stylesheet, :href "/todomvc.css"})) (ui/range n (e/fn [v] (e/server (reset! !n v))) (dom/props {:min 1 :max 25 :step 1})) (dom/div (dom/props {:class "todomvc" :style {:position "relative"}}) (dom/h1 (dom/text "TodoMVC")) (e/for [i (range n)] ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< (let [!focused (atom false) focused (e/watch !focused)] (dom/div (dom/props {:style {:position "absolute" :width "50vw" :left (str (* i 40) "px") :top (str (-> i (* 40) (+ 60)) "px") :z-index (+ i (if focused 1000 0))}}) (dom/on "mouseenter" (e/fn [_] (reset! !focused true))) (dom/on "mouseleave" (e/fn [_] (reset! !focused false))) (todomvc/TodoApp. state))))))))))) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -
dustingetz revised this gist
Feb 13, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ ::ui/input-event (p/fn [e] (p/server (reset! !n (p/client (.. e -target -value)))))}) (dom/div {:class "todomvc" :style {:position "relative"}} (dom/h1 "TodoMVC") (p/for [i (range n)] ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< (let [!focused (atom false) focused (p/watch !focused)] (ui/element dom/div {::dom/style {:position "absolute" -
dustingetz renamed this gist
Sep 22, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
dustingetz revised this gist
Sep 22, 2022 . 3 changed files with 6 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ # Photon demo – TodoMVC Composed * An early demonstration "Compiler Managed Network" and the extreme dynamic composition it makes possible * It's just a for loop!!! https://user-images.githubusercontent.com/124158/186675049-c2e55723-455b-4892-a8ab-9d904698c198.mp4 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +0,0 @@ File renamed without changes. -
dustingetz renamed this gist
Aug 26, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
dustingetz created this gist
Aug 26, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ # demo of the extreme dynamic composition that composable network makes possible It's just a for loop!!! https://user-images.githubusercontent.com/124158/186675049-c2e55723-455b-4892-a8ab-9d904698c198.mp4 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ (ns user.demo-todomvc-composed (:require #?(:clj [datascript.core :as d]) [hyperfiddle.photon :as p] [hyperfiddle.photon-ui :as ui] [hyperfiddle.photon-dom :as dom] [user.demo-5-todomvc :as todomvc]) #?(:cljs (:require-macros user.demo-todomvc-composed))) (def !n #?(:clj (atom 1))) (p/defn App [] (let [state (p/watch todomvc/!state) n (p/server (p/watch !n))] (p/server (binding [todomvc/db (p/watch todomvc/!conn) todomvc/tx-delay (::todomvc/delay state) todomvc/transact! (partial d/transact! todomvc/!conn)] (p/client (dom/link {:rel :stylesheet, :href "todomvc.css"}) (ui/input {::dom/type "range" ::dom/min 1 ::dom/max 25 ::dom/step 1 ::ui/value n ::ui/input-event (p/fn [e] (p/server (reset! !n (p/client (.. e -target -value)))))}) (dom/div {:class "todomvc" :style {:position "relative"}} (dom/h1 "TodoMVC") (p/for [i (range n)] (let [!focused (atom false) focused (p/watch !focused)] (ui/element dom/div {::dom/style {:position "absolute" :width "50vw" :left (str (* i 40) "px") :top (str (-> i (* 40) (+ 60)) "px") :z-index (+ i (if focused 1000 0))} ::ui/mouseenter-event (p/fn [e] (reset! !focused true)) ::ui/mouseleave-event (p/fn [e] (reset! !focused false))} (todomvc/TodoApp. state))))))))))