-
-
Save charles-dyfis-net/28671a8faefeb1451c4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; ...the method... | |
(defn build [grid-atom source-atom source-func selector | |
& {:keys [columns-fn columns options]}] | |
(if (nil? @grid-atom) | |
(let [columns-val (or (and columns-fn (columns-fn @source-atom)) | |
columns)] | |
(reset! grid-atom | |
{:grid-obj (new js/Slick.Grid selector | |
(clj->js (source-func @source-atom)) | |
(clj->js columns-val) | |
(clj->js (or options {}))) | |
:selector selector | |
:columns columns-val | |
:columns-fn columns-fn | |
:options options}) | |
(add-watch source-atom selector | |
(fn [key ref old new] | |
(update grid-atom ref source-func new)))) | |
(update grid-atom source-atom source-func))) | |
;;; ...called as... | |
(grid/build grid-obj grid-data get-grid-data "#phase1-grid" | |
:columns grid-columns | |
:options grid-options) | |
;;; ...yields the warning... | |
; WARNING: Wrong number of args (8) passed to releng.ui.grid/build at line 85 src/main/clojurescript/releng/create/phase1.cljs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment