0

Using Light Table, how do I tell Om to re-render the DOM after eval'ing a modified Om function?

Forcing a swap! on the main state atom has no effect: (swap! app-state identity)

Cycling routes explicitly with (swap! app-state assoc :current-page :about) and back to home with (swap! app-state assoc :current-page :home), reflect changes to the home page.

My browser is connected to Light Table and I can trigger alerts with, e.g. (js/alert "hi")

Calling the root again also triggers a render:

(root app app-state
      {:target (. js/document
                  (getElementById "site"))})

Why doesn't Om trigger a render on app-state atom swap!?

Petrus Theron
  • 27,855
  • 36
  • 153
  • 287

1 Answers1

2

In Om, you should modify your application state atom with om/update! and om/transact!.

skillet-thief
  • 549
  • 4
  • 8