Fork me on GitHub
#reitit
<
2023-02-07
>
orestis09:02:02

In a frontend context, I'm trying to push-state but also include an anchor parameter (so e.g. the constructed url is /foo/bar/baz#comment-section - but I can't figure out how page anchors are handled in reitit, since push-state accepts only [k params query]

Mario Trost09:02:02

We have our own push-state-by-path :

(.pushState js/window.history nil <path>)
(rfh/-on-navigate @rfe/history <path>)
with rfh = reitit.frontend.history and rfe = reitit.frontend.easy

orestis10:02:41

Yeah I did just the same just now 🙂

Eric Dvorsak19:02:21

When doing spec coercion in reitit i noticed that inst? isn't coerced if the date has more than millisecond precision, eg:

development> (spec-tools.transform/string->date nil "2023-02-07T18:04:18.146333Z")
"2023-02-07T18:04:18.146333Z"
development> (spec-tools.transform/string->date nil "2023-02-07T18:04:18.146Z")
#inst "2023-02-07T18:04:18.146-00:00"
Might make sense to use clojure.instant/read-instant-date in that spec-tools.transfor/string->date?
development>   (clojure.instant/read-instant-date "2023-02-07T18:04:18.146111Z")
#inst "2023-02-07T18:04:18.146-00:00"
development>   (clojure.instant/read-instant-date "2023-02-07T18:04:18.146Z")
#inst "2023-02-07T18:04:18.146-00:00"
development>   (clojure.instant/read-instant-date "2023-02-07T18:04:18.146")
#inst "2023-02-07T18:04:18.146-00:00"
development>   (clojure.instant/read-instant-date "2023-02-07T18:04:18.146")
#inst "2023-02-07T18:04:18.146-00:00"