(defmulti read om/dispatch)
(defmethod read :default
[{:keys [state]} k _]
(let [st @state]
{:value (get st k)}))
(defmethod read :foo
[{:keys [state query]} k _]
(let [st @state]
(if-let [d (get st k)]
{:value (when-let [d (get st k)]
(om/db->tree query d st))}
{:remote true})))
(defui SomeComponent
static om/IQuery
(query [_]
[:foo
;; The text in the render function will only show up if either :foo has a value, or :bar is added to this query.
])
Object
(render [this]
(dom/div nil "No matter what, this should render")))
(def parser (om/parser {:read read}))
(def reconciler
(om/reconciler
{:parser parser
:state {:bar 42}}))