reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
Oz 2021-01-12T02:01:52.045900Z

Hi, I have this nested route,

["/:project"
      {:name :project
       :view #'project/project-view
       :controllers
       [{:parameters {:path [:project]}
         :start (fn [parameters]
                  (re-frame/dispatch [:update-displays-from-db (-> parameters :path :project)])
                   (prn "hello project")
                  (active-view :project-view)
                  )
         :stop (fn [& params] (js/console.log "goodbye project"))}]}
      [""]
      ["/displays/:display"
       {:name :display
        :view #'display-form/edit-display-form
        :controllers
        [{:parameters {:path [:display]}
          :start (fn [parameters]
                   (re-frame/dispatch [:update-elements-from-db])
                   (prn "hello display")
                   (active-view :display-view)
                   )
          :stop (fn [& params] (js/console.log "goodbye display"))}]}]
      ]
When I navigate backwards from "/project/displays/display" to "/project" The :start controller doesn't run. When I navigate forward - to "/project" or to "/project/displays/display", the :start controller runs without problem. Any idea what could be the cause?

Oz 2021-01-12T02:03:05.046900Z

Also a tip on how to match both "/something" and "/something/" as the same route?

Oz 2021-01-13T09:50:54.052800Z

Took the solution from this pull request https://github.com/metosin/reitit/pull/239

Oz 2021-01-12T02:03:59.047200Z

Thank you 🙏