Fork me on GitHub
#reitit
<
2019-06-19
>
abdullahibra09:06:02

hey guys, howto handle authenticated pages with reitit ?

juhoteperi10:06:48

Example defaults to pages requiring authentication, with metadata declaring page as public. But with similar approach one can use metadata to declare e.g. required roles for a route.

abdullahibra11:06:11

guys how can i add dispatch events to be run after the refreshing the page?

Toni Vanhala12:06:26

You can use controllers for this; in this case start controller is run when you enter the route with the controller https://metosin.github.io/reitit/frontend/controllers.html For example:

:controllers [{:start #(rf/dispatch [::events/reset-widget-list])}]

abdullahibra10:06:23

perfect! , thanks

abdullahibra11:06:39

refreshing works perfectly, but i need to run some events after the refresh page done

abdullahibra11:06:58

is there reitit capabilities for handling this ?

abdullahibra11:06:55

also what is the difference between push-state and replace-state ?

Toni Vanhala12:06:26

push state adds to the history, replace state swaps the old one out

abdullahibra10:06:30

Thank you 🙂