There are a few other client side routing libraries that support bidirectional 
linking. One of them is Bidi (https://github.com/juxt/bidi) on their README 
there's a list of possible alternatives.

In my app I'm using a combination of Secretary with some parts of Accountant 
(https://github.com/venantius/accountant), in order to navigate between routes 
without reloading the page. There's a blog post here that may help: 
https://pez.github.io/2016/03/01/Reagent-clientside-routing-with-Bidi-and-Accountant.html

For me, to be able to generate the link from a route, I used Secretary's "named 
routes" feature

So, in order to get a link I do something like:

#(site/detail-entry-route {:detailEntryId (.toString (:_id %))})

which returns the link to some detail url.

And the Secretary part looks like:

(secretary/defroute detail-entry-route "/detail-entry/:detailEntryId" 
[timerollEntryId]
  (session/put! :current-page :detail-page)
  (session/put! :selected-item-id detailEntryId))

In Secretary the feature is called "named routes": 
https://github.com/gf3/secretary#named-routes

Hope that helps,
Torsten.


Am Samstag, 22. April 2017 19:13:33 UTC+2 schrieb Jonathon McKitrick:
> I have an app that's been working wonderfully for a few years now. I want to 
> improve it by adding links. If you see a person's name, I want to be able to 
> click on that name and the app will jump to the 'user' page (simple enough) 
> and then move the browser view to that particular item. In static HTML we'd 
> obviously do that with a # and an anchor. But with Reagent, I'm not quite 
> sure.
> 
> I'm exploring Secretary right now, but what's the missing piece that will get 
> me from a link to a Reagent-rendered page and then jumping to that row or 
> even opening a modal with that item?

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to