Questions tagged [secretary]

A client-side router for ClojureScript.

See https://github.com/gf3/secretary.

8 questions
10
votes
2 answers

How to get query parameters in clojurescript?

I'm using secretary and reagent. This is my code : (def view (atom nil)) (defn layout [view] [:div @view]) (reagent/render-component [layout view] (.getElementById js/document "message")) (secretary/set-config! :prefix "") (secretary/defroute…
Viktor K.
  • 2,670
  • 2
  • 19
  • 30
3
votes
1 answer

Routing using default template in reagent

I am trying to use reagent to build my very basic project but I have a problem with routing and its parameter. This is from reagent looks like EDITED - :require s added (ns hammerslider.core (:require [reagent.core :as reagent :refer [atom]] …
Ampersanda
  • 2,016
  • 3
  • 21
  • 36
3
votes
1 answer

In ClojureScript, why can't I navigate to a URL entered by hand, but if I click a link it works?

(Note, I'm using Reagent, Secretary, and Compojure (among others)) I want to create a route /sectest/:id, and if I point my browser to that route, I get the following error: Resource interpreted as Stylesheet but transferred with MIME type…
Josh.F
  • 3,666
  • 2
  • 27
  • 37
2
votes
1 answer

Clojure Secretary - Dispatch on URL Change

Can Secretary dispatch routes based on a submitted browser url, the way many javascript routing frameworks work? I can't seem to find any examples of wiring this up. For example, when you enter http://myapp.com/#/my/route in the browser's url, I'd…
Scott Klarenbach
  • 37,171
  • 15
  • 62
  • 91
1
vote
2 answers

defroute not fired on page load

I have application routes defined in my routes.cljs file in the root of src/cljs/project/routes.cljs. (defn app-routes [] (secretary/set-config! :prefix "#") (defroute "/" [] (re-frame/dispatch [::events/set-active-panel…
Clarice Bouwer
  • 3,631
  • 3
  • 32
  • 55
0
votes
1 answer

Get all of named routes

I am currently learning reagent with secretary as its route. I find that I can use query-params to get a hash-map of all parameters with question mark (?) like ?name=Daniel (ns feampersanda.core (:require-macros [secretary.core :refer…
Ampersanda
  • 2,016
  • 3
  • 21
  • 36
0
votes
0 answers

Secretary Routing, Ident Query in om.next

I will preface this question by saying I am still very much a novice when it comes to Clojure/Script, so besides the very pointed question I will pose any general feedback about style, usage would be greatly appreciated. I have been building a very…
Colin Teal
  • 1
  • 1
  • 2
0
votes
1 answer

Clojurescript + Om: wait for state change, then do something

I am trying to make a Clojurescript app that shows recipes. Relevant code follows (also available as a gist): (defn load-recipes [data] (go (if (not (:loaded? @data)) (let [recipes-data (
Michiel Borkent
  • 34,228
  • 15
  • 86
  • 149