I've recently been reading a lot about core.async and the different ways it can 
be useful for building interactive/reactive interfaces. I was reading through 
David Nolen's blog (http://swannodette.github.io/2013/08/17/comparative/) and 
the corresponding code 
(https://github.com/swannodette/swannodette.github.com/blob/master/code/blog/src/blog/autocomplete/core.cljs)
 and was confused by the of protocols here when setting up the DOM modification 
functions. To me it seems like they could just be helper functions, but I'm 
likely missing something. What is the advantage of defining the protocols and 
extending the existing types?

For a simple example of what I mean, I made a gist:
https://gist.github.com/jmmk/54857dd919cb7ff70086

One has simple functions hide! and show! that modify an element, and the other 
defines the protocol and extends the HTMLElement to include -hide! and -show!. 
What are the tradeoffs here?

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to