Skip to content
Browse files

Added obj as return

  • Loading branch information...
1 parent e434da6 commit ae054a538818c236061ed2020d54ea57a1d579c1 @fogus fogus committed
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/cljs/cljs/core.cljs
View
7 src/cljs/cljs/core.cljs
@@ -3218,10 +3218,13 @@ reduces them without incurring seq initialization"
[multifn] (-prefers multifn))
(defn extend-object
- ""
+ "Takes a JavaScript object and a map of names to functions and
+ attaches said functions as methods on the object. The attached
+ methods will resolve the implict this as the object."
[obj fn-map]
(doseq [[key-name f] fn-map]
(let [str-name (name key-name)
bind-fn (goog.bind f obj)]
- (js* "~{obj}[~{str-name}] = ~{bind-fn}"))))
+ (js* "~{obj}[~{str-name}] = ~{bind-fn}")))
+ obj)

0 comments on commit ae054a5

Please sign in to comment.
Something went wrong with that request. Please try again.