Fork me on GitHub
#re-frame
<
2017-08-11
>
stvnmllr202:08:46

Can someone point me to how to handle changing the url after an event is dispatched? Guessing it's just plain javascript, but i'm sort of new to all that

stvnmllr202:08:10

specifically in this case, after i delete a record, i'd like to go back to a different view, which has a different url. Using secretary if that may have something to help with this

lumpy09:08:49

@stvnmllr2 I created a custom fx for that called route.

(rf/reg-fx
  :route
  (fn [route]
    (let [prefix (sec/get-config :prefix)]
      (set! (.-location js/document) (str prefix route)))))

sandbags13:08:59

it came up from a HN thread about Bootstrap4, as a cleaner alternative to Bootstrap that was more modular and no JS required

yedi16:08:11

so I'm storing a bunch of components in one file. they're ones that should be rendered on every page (Footer, Navigation, etc)

yedi16:08:29

what's a good name for this namespace?

yedi16:08:51

i'm thinking (ns project.views.global)

jebberjeb18:08:35

@yedi I think I used project.views.common last time.

jebberjeb18:08:47

not my idea, but I like “common”