scittle

ray 2022-12-05T16:56:46.239389Z

Something I am observing in the https://github.com/raymcdermott/aoc22 ... the atoms do not seem to be respected per namespace .... for example each ns has this: (def part-1-visible? (r/atom false)) and the buttons toggle its value. But if its set in one ns, it's set in them all. Is that expected or am I holding it wrong?

borkdude 2022-12-05T17:10:30.136949Z

@raymcdermott I debugged this locally and added to the home-screen:

(defn home-page
  []
  (let [solution-data (edn/read-string @solutions)]
    [:div.m-3.p-3.border-0
     [days solution-data]
     [:div
      (str @day1/part-1-visible?)
      (str @day3/part-1-visible?)]]))
You can quite clearly see that the values can be different at different times, so maybe there's something else going wrong. As you're having quite a lot of state scattered around, it's difficult to keep track of things. It's usually good to put more state together in one atom, e.g. for the entire app. Scittle also has a re-frame plugin which I think is quite good for this multi-screen type of thing

ray 2022-12-05T17:12:49.742569Z

ok - I'll make each of the atoms named by the ns

borkdude 2022-12-05T17:19:57.906789Z

https://aoc-rmc.github.io/aoc22/ <- here's @raymcdermott AoC solutions in scittle :)

ray 2022-12-05T17:22:03.393389Z

reframe will be a decent size re-write so 🤷🏼‍♂️

borkdude 2022-12-05T17:23:18.408739Z

are you saying you have something better to do than writing Clojure?

ray 2022-12-05T17:23:36.675359Z

no but I have to catch up with days 4 and 5 🙂

borkdude 2022-12-05T17:23:47.066719Z

oh it's already that late?

borkdude 2022-12-05T17:24:14.050319Z

good luck :-D

ray 2022-12-05T17:24:30.329269Z

I'm on holiday next week so I can catch up properly then 🙂

ray 2022-12-05T17:25:29.140749Z

what I find odd is that there is an atom called data that is not polluted across the namespaces ... must be something else

borkdude 2022-12-05T17:26:18.424629Z

as I've shown before, it is not a namespace cross-pollution problem, since the atoms can be set independently

ray 2022-12-05T17:26:58.642639Z

yeah I think there is a function that is being re-defined ... gonna put that in the helper

ray 2022-12-05T17:42:20.826469Z

not that ... it's that a bunch of the divs have the same targetID FFS 🙂

😆 1
borkdude 2022-12-05T17:42:32.650679Z

:)