This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-19
Channels
- # beginners (7)
- # boot (48)
- # clojure (50)
- # clojure-portugal (1)
- # clojure-russia (10)
- # clojure-spec (29)
- # clojure-uk (9)
- # clojurescript (116)
- # core-logic (1)
- # cursive (12)
- # datascript (2)
- # datomic (7)
- # defnpodcast (8)
- # dirac (80)
- # emacs (486)
- # hoplon (5)
- # instaparse (3)
- # keechma (1)
- # luminus (3)
- # lumo (35)
- # off-topic (65)
- # om (6)
- # onyx (6)
- # perun (42)
- # re-frame (5)
- # reagent (5)
- # rum (2)
- # untangled (170)
- # vim (13)
How do I properly solve the following? I have a search box and a list of entities (local, just an array of constants). I'd like to display a list of matching entities when contents of search box change, where matching is complicated (case-sensitivity, alternate names, g and ġ are the same, å and aa are the same – all the typical cornucopia of manual data entry).
Something along the lines of (re-frame/reg-sub :matching (fn [db] (do-the-complicated-match (:search-string db))))
. Will that only be invoked once per change in (:search-string db)
?
@dottedmag I would have an entry in my app-db called :filtered-list (which I can subscribe to), which was updated to reflect the search when I dispatch the search phrase to the appropriate handler OR use a component that subscribes to the whole list and create the search result as component local state.
I've been reading the excellent doc on re-frame-async-flow-fx. I'm curious that though the example mentions websockets it seems to imply that re-frame-async-flow-fx is for initialization and should be cleaned up when that phase is over. However, I'm thinking of a websocket that stays open for the life of the session... is this envisioned in re-frame-async-flow-fx as well?