<commit_before>(ns yadnd5ecs.core
  (:require [om.core :as om :include-macros true]
            [om-tools.dom :as dom :include-macros true]
            [om-tools.core :refer-macros [defcomponent]]))

(enable-console-print!)

(def app-state (atom {:text "Hello Chestnut!"}))

(defcomponent app-view
  [app owner]
  (render [_]
          (dom/h1 (:text app))))

(defn main []
  (om/root
    app-view
    app-state
    {:target (. js/document (getElementById "app"))}))<commit_msg>Add name for player and character<commit_after>(ns yadnd5ecs.core
  (:require [om.core :as om :include-macros true]
            [om-tools.dom :as dom :include-macros true]
            [om-tools.core :refer-macros [defcomponent]]))

(enable-console-print!)

(def app-state (atom {:name {:player "Bob"
                             :character "Bruenor"}}))

(defcomponent name-view
  [name owner]
  (render
   [_]
   (let [{:keys [player
                 character]} name]
     (dom/span
      (dom/h1 (str "Name: " player))
      (dom/h1 (str "Character: " character))))))

(defcomponent app-view
  [app owner]
  (render
   [_]
   (dom/div
    (dom/h1 (str "Hello " (-> app :name :character)
                 (when-let [name (-> app :name :player)]
                   (str " (" name ")"))
                 "!"))
    (om/build name-view (:name app)))))

(defn main []
  (om/root
    app-view
    app-state
    {:target (. js/document (getElementById "app"))}))
{'fraction_non_alphanumeric': 0.16933797909407666, 'fraction_numerical': 0.004181184668989547, 'mean_word_length': 2.331786542923434, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1527196', 'n_tokens_mistral': 500, 'n_tokens_neox': 487, 'n_words': 120}