helix

https://github.com/Lokeh/helix
jaime 2020-07-08T20:02:43.313900Z

Hi, anyone have an example app using reitit frontend router and helix?

jaime 2020-07-08T20:42:13.314Z

Not an app, but I'm using this one right now as start.

(defnc root []
  (let [[match set-match] (hooks/use-state nil)
        view (get-in match [:data :view])]
    (rfe/start!
      router
      (fn [m]
        (when (not= m match)
          (set-match m)))
      {:use-fragment true})
    ($ :div {:class ""}
      ($ :a {:href (rfe/href :limeray.web.routes/home)} "back")
      ($ :a {:href (rfe/href :limeray.web.routes.goals/add)} "New Goal")
      (when view
        ($ view match)))))
Routes
(def routes
  [["/"
    {:name :limeray.web.routes/home
     :view home-view}]
   ["/goals"
    ["/"
     {:name :limeray.web.routes/goals
      :view list-view}]
    ["/add"
     {:name :limeray.web.routes.goals/add
      :view add-goal-view}]]])