mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 08:21:11 +00:00
Fix reader conditional example
The previous example only worked by accident (because there was an even number of map keys with conditional values).
{:get #?(:clj 1), :post #?(:clj 2)} gets read as {:get :post} in a non-clj context. The splicing reader conditional or a :cljs (or :default) value is needed to have the code work as intended. Here we change the docs to use the splicing version, as that is (imho) more beautiful than adding another branch.
This commit is contained in:
parent
31d2bc5832
commit
9e05d58880
1 changed files with 2 additions and 2 deletions
|
|
@ -17,8 +17,8 @@ There are multiple options to use shared routing table.
|
||||||
(def routes
|
(def routes
|
||||||
["/kikka"
|
["/kikka"
|
||||||
{:name ::kikka
|
{:name ::kikka
|
||||||
:get #?(:clj {:handler get-kikka})
|
#?@(:clj [:get {:handler get-kikka}])
|
||||||
:post #?(:clj {:handler post-kikka})}])
|
#?@(:clj [:post {:handler post-kikka}])}])
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using custom expander
|
## Using custom expander
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue