venantius / accountant

ClojureScript navigation for single-page applications, made simple.
Eclipse Public License 1.0
250 stars 39 forks source link

prevent default? #27

Closed jdkealy closed 7 years ago

jdkealy commented 8 years ago

Hi,

I'd like to add a click handler that prevents navigation when -- for example -- the user is not signed in. It seems that the on-click gets fired after the navigation occurs, so I'm wondering if there's any way to do this. Many thanks.

venantius commented 8 years ago

My naive response would be that you should just make the thing the user is clicking a button, not a link, and have your on-click handler for the button trigger Accountant's navigate! function if the user is logged in.