This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-16
Channels
- # adventofcode (99)
- # announcements (2)
- # babashka (37)
- # beginners (111)
- # cider (4)
- # cljsrn (5)
- # clojure (51)
- # clojure-australia (2)
- # clojure-chicago (3)
- # clojure-europe (141)
- # clojure-nl (2)
- # clojure-provo (2)
- # clojure-spec (48)
- # clojure-sweden (2)
- # clojure-uk (26)
- # clojurescript (34)
- # conjure (1)
- # core-logic (5)
- # cursive (16)
- # datomic (2)
- # events (2)
- # fulcro (54)
- # graphql (13)
- # jobs-discuss (116)
- # kaocha (14)
- # meander (101)
- # off-topic (41)
- # pathom (6)
- # planck (3)
- # re-frame (53)
- # reagent (10)
- # reitit (1)
- # reveal (13)
- # shadow-cljs (35)
- # spacemacs (22)
👋 Thursday last week was my last day of work for the year - nice to have a relaxing finish to the year.
morning
månmån
morning
FWIW i prefer routes defined as functions that take maps
i like being able to execute them in the repl
i like being able to unit test them like regular fns
how does every route as a function work @jiriknesl? do they get called in sequence until one says yes ?
Is it common, if you have a map and a value to a key is a function, to name the key something like foo-bar-fn
?
@dharrigan I lean toward -fn
(and you'll see that in next.jdbc
and elsewhere in my OSS code) but I don't know how widespread that is...
i often use type-specific suffixes like -fn
or -p
for promises, -ch
for channels, -s
for streams...
i find it especially helpful in code where you have both wrapped and unwrapped versions of something floating around
@mccraigmccraig as @dharrigan says, your route is a triplet of name (keyword), url->action (fn), action->url (fn). Action route goes through all url->action which either return controller action with params or nothing. The last in a row is default catchall error router.