reveal

Docs: https://vlaaad.github.io/reveal/ Source: https://github.com/vlaaad/reveal
vlaaad 2020-09-03T20:30:55.005500Z

ah, I can't wait to finish writing the docs, it's turning out so nice

vlaaad 2020-09-03T20:31:16.005800Z

so many interesting possibilities

vlaaad 2020-09-03T20:31:58.006600Z

I made a little demo that uses integrant to build a simple server, and it's state is managed in an agent

vlaaad 2020-09-03T20:32:36.007500Z

using very little code, I can make a monitor of that system that both shows it's state and contains controls to start it and stop it

vlaaad 2020-09-03T20:33:05.007700Z

e.g.:

(re/viewed-as-is
  {:fx/type re/observable-view
   :ref system
   :fn (fn [state]
         {:fx/type :v-box
          :children [{:fx/type re/value-view
                      :v-box/vgrow :always
                      :value state}
                     {:fx/type :h-box
                      :children [{:fx/type :button
                                  :disable (not state)
                                  :text "Stop"
                                  :on-action (fn [_] (stop!))}
                                 {:fx/type :button
                                  :disable (some? state)
                                  :text "Start"
                                  :on-action (fn [_] (start!))}]}]})})

vlaaad 2020-09-03T20:34:46.008500Z

And here is how it can be viewed: note that it displays both the state and buttons to start/stop it

vlaaad 2020-09-03T20:35:39.009300Z

and whenever the system is started/stopped from the repl, this view is immediately updated

vlaaad 2020-09-03T20:57:22.009800Z

"build your own watcher"