<commit_before>(ns warehouse.subs
  (:require
   [warehouse.util :as util]
   [warehouse.infinite-scroll.db :as scroll]
   [warehouse.search.db :as search]
   [re-frame.core :refer [reg-sub subscribe]]
   [warehouse.search.db :as search]))

(reg-sub
 :visible-components
 (fn
   [db _]
   (if (search/filter-active?)
     (select-keys (:components db) (map #(get % "ref") (search/filter-search)))
     (:components db))))

(reg-sub
 :infinite-scroll-state
 (fn
   [db _]
   (:infinite-scroll db)))

(reg-sub
 :scroll-data-visible-components
 (fn [_ _]<commit_msg>[frontend]: Fix visible components sub<commit_after>(ns warehouse.subs
  (:require
   [warehouse.util :as util]
   [warehouse.infinite-scroll.db :as scroll]
   [warehouse.search.db :as search]
   [re-frame.core :refer [reg-sub subscribe]]
   [warehouse.search.db :as search]))

(reg-sub
 :visible-components
 (fn
   [db _]
   (if (search/filter-active? db)
     (select-keys (:components db) (map #(get % "ref") (search/filter-search db)))
     (:components db))))

(reg-sub
 :infinite-scroll-state
 (fn
   [db _]
   (:infinite-scroll db)))

(reg-sub
 :scroll-data-visible-components
 (fn [_ _]
{'fraction_non_alphanumeric': 0.17026793431287812, 'fraction_numerical': 0.0, 'mean_word_length': 3.6135458167330676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5194473', 'n_tokens_mistral': 426, 'n_tokens_neox': 414, 'n_words': 92}