On Saturday, June 13, 2015 at 9:00:25 PM UTC+10, Andreas Liljeqvist wrote:
> I couldn't find any place to discuss it on the relevant github.
> 
> 
> Can anyone explain to me why dispatch, subscribe, register-handler and 
> register-sub all use a vector as an argument?
> 
> 
> Like this:
> (dispatch [:remove-item 25])
> vs
> (dispatch :remove-item 25)
> 
> 
> 
> same for subscribe:
> (subscribe [:items])
> 
> vs
> (subscribe :items)
> 
> 
> I think the vector-less version seems more idiomatic?
> Similarities to assoc and such.
> 
> 
> (I love re-frame, asking about design decisions is a good way to learn)


Events should be captured/represented as a single piece of data - a vector or 
map are the most obvious choices. The former was chosen. 

When the data is captured this way it becomes easy to log, convey, etc. 
Processing functions have a known arity, etc. 

Everything is a lot easier.

--
Mike

-- 
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