Skip to content

automate binding? #1

@stephanos

Description

@stephanos

Would it be possible to pass-in some kind of "DataScriptCursor" into a component? Like this:

(defn app-view []
  (reify
    om/IRender
    (render [_]
      (let [count (query q-count)] ; count is a 'DataScriptCursor'
        (dom/div nil
          (dom/h2 nil "Hello World")
          (om/build #(app-counter count) {})))))) ; app-counter receives a 'DataScriptCursor'

Then maybe the manual binding could be removed:

om/IWillMount
(will-mount [_]
  (od/project-onto conn app app-projections))
om/IWillUnmount
(will-unmount [_]
  (od/unproject-from conn app app-projections))

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions