On 28 November 2014 at 10:28, Colin Yates <colin.ya...@gmail.com> wrote: > > Am I right in thinking that in order to use > https://github.com/stuartsierra/component every consumer of a component > must also be a component? >
Nope. > For example, if I have a component DB and I want to use that DB in (defn > blob-query [db criteria]...), do I pull the DB out of the system map and > call it or am I expected to make a BlobQuery component which offers a > (blob-query [criteria]) API? > You only need to make something a component if it has a lifecycle. If you just want to use a database connection, pass the component as an argument to a function. Look at it another way: do you need to keep blob-query around? Does it have state? If not, then it doesn't need to be a component. - James -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.