This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-17
Channels
- # announcements (2)
- # asami (3)
- # babashka (30)
- # beginners (23)
- # calva (28)
- # cider (3)
- # clj-kondo (16)
- # clj-on-windows (7)
- # cljs-dev (7)
- # clojure (47)
- # clojure-austin (3)
- # clojure-europe (25)
- # clojure-gamedev (3)
- # clojure-greece (1)
- # clojure-nl (1)
- # clojure-uk (3)
- # clojurescript (54)
- # community-development (24)
- # conjure (16)
- # duct (1)
- # emacs (8)
- # events (1)
- # figwheel-main (4)
- # fulcro (13)
- # gratitude (20)
- # helix (3)
- # honeysql (8)
- # hyperfiddle (12)
- # introduce-yourself (1)
- # jobs (6)
- # lambdaisland (1)
- # lsp (23)
- # malli (1)
- # meander (26)
- # minecraft (11)
- # off-topic (12)
- # pathom (1)
- # portal (11)
- # releases (1)
- # remote-jobs (1)
- # ring (11)
- # sci (1)
- # shadow-cljs (53)
- # specter (5)
- # xtdb (20)
Hi channel! I’m trying to implement feature flags on my project, I saw some cool https://github.com/lambdaisland/pennon for some inspiration, but I saw they are fetching the flags inside a middleware, means additional get request to all flags in every request - and I’m not sure why, it sounds not efficient. what do you think? is somebody has an idea? feels like I’m missing something
I'm not familiar with the library but it looks quite generic. It's probably not directly concerned in how exactly you fetch the flags. If that's expensive, then perhaps you want some caching? (caching them just for a few seconds might be enough).
I'm using re-frame. Is there a correct way to dispatch events in succession? To my knowledge dispatch enqueues events and dispatch-sync doesn't seem to be the correct tool for this.
Any reason multiple dispatches wouldn't work? https://day8.github.io/re-frame/api-builtin-effects/#dispatch
I had not seen that part of the effect api
it works when I put it in the :fx
instead of multiple re-frame/dispatch calls in a callback
Does using a fully qualified symbol mean I don't have to require the namespace the symbol is in to use it?
yes, but you still have to ensure the namespace that defines that var has been loaded
@U064X3EF3 it could be loaded by having been previously required in some other place, right? Are there some other ways that could happen?
yes, and no, respectively
something has to load the namespace before the vars exist to find them
but once it is loaded, you can always use a fq name to refer to it. shorter names via aliases are a per-namespace naming convenience
I see. Aliases are just an entry in ns-aliases which is part of the ns-map. Thanks!
This returning Null , where am I doing wrong! I am trying to filer the data where index is 1 2 3
(def data [{:name "john" :address "NY" :index 0}
{:name "David" :address "LO" :index 1}
{:name "Anand" :address "PA" :index 2}
{:name "Popeye" :address "CA" :index 3}
{:name "Tina" :address "RS" :index 4}])
(println (filter #(= (get % :index) (range 1 3)) data))
You're taking the index, e.g. 1
and comparing it to '(1 2 3)
. That's why they don't match.
You can do (filter #(#{1 2 3} (:index %)) data)
You can use some
instead
filter is an operation on collections. Write a predicate function valid-index?
that takes a single map as input and returns logical true or false.
Then all you have to do is (filter valid-index? data)
You're trying to solve two problems at the same time.