Skip to content

Commit

Permalink
boot-single
Browse files Browse the repository at this point in the history
  • Loading branch information
leonoel committed Aug 2, 2024
1 parent 6e2465e commit 72ca639
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/hyperfiddle/electric_de.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ A mount point can be :
`(r/client (hyperfiddle.electric-client-de/connector hyperfiddle.electric-client-de/*ws-server-url*)
(r/->defs {::Main ~source}) ::Main)))

(defmacro boot-single [opts Main & args]
(let [env (merge (lang/normalize-env &env) web-config opts)
source (lang/->source env ::Main `(fn [] ($ ~Main ~@args)))]
`(r/client (constantly m/never)
(r/->defs {::Main ~source}) ::Main)))

;; (cc/defn -snapshot [flow] (->> flow (m/eduction (contrib.data/take-upto (complement #{r/pending})))))
(cc/defn -snapshot [flow] (->> flow (m/eduction (contrib.data/take-upto (comp pos-int? :degree)))))

Expand Down

0 comments on commit 72ca639

Please sign in to comment.