I really am dense at times. :(
I was confusing the 'component' for the system map in this
line:
https://github.com/weavejester/duct/blob/master/duct/src/duct/component/endpoint.clj#L6
#PalmToFace
-d
On Tuesday, June 9, 2015 at 5:57:48 PM UTC-5, James Reeves wrote:
On 9 June 2015 at 23:16,
I think the most important rule when using component is to only use local
state like Timothy stated, i.e. nothings gets def-ed. You could write an
application that a -main function that starts the system and you would
never need a global reference to the system.
In practise however, you do make
On Tue, Jun 9, 2015 at 6:12 AM, Timothy Baldridge tbaldri...@gmail.com
wrote:
Stuart addresses two anti-patterns in your PRs. Perhaps I can help explain
them.
Let's say we have a system that looks like this:
(defrecord DBConnection [])
(defrecord DBLayer [db-connection])
(defrecord
On 9 June 2015 at 23:16, Dru Sellers d...@drusellers.com wrote:
@James do you only have one component that has all of your routes? or do
you have each component supply its own routes? If you imagine a component
providing its own routes, I'd love to see a duct example with two routes
set up.
@James do you only have one component that has all of your routes? or do
you have each component supply its own routes? If you imagine a component
providing its own routes, I'd love to see a duct example with two routes
set up.
I believe that would be multiple endpoint components.
Looking
at
Hey Dru
Take a look at Duct: https://github.com/weavejester/duct
If you make a new app using that template, you should get some
pointers from the boilerplate it generates.
cheers,
Jonathan
On Mon, Jun 8, 2015 at 5:51 PM, Dru Sellers d...@drusellers.com wrote:
So, I guess I am a bit lost, how
My recommendation is to use a closure. So I'd write your example as:
(defn username-endpoint [{:keys [db]}]
(routes
(GET /:username [username]
(let [user (users/get-user db username)]
(str h1Hello (:name user) /h1)
So you pass your configuration map into the endpoint
Stuart addresses two anti-patterns in your PRs. Perhaps I can help explain
them.
Let's say we have a system that looks like this:
(defrecord DBConnection [])
(defrecord DBLayer [db-connection])
(defrecord AppLayer [db-layer])
We can construct a system thusly:
{:db-connection (-DBConnection