Skip to content

Instantly share code, notes, and snippets.

@rasoliveira
Created September 17, 2015 02:12
Show Gist options
  • Save rasoliveira/1e1a045c5e24cf36c205 to your computer and use it in GitHub Desktop.
Save rasoliveira/1e1a045c5e24cf36c205 to your computer and use it in GitHub Desktop.
(dispatcher/dispatch ['id1 'id2] [:event :arg :arg])
(dispatcher/dispatch :all [:event :arg])
(dispatcher/dispatch :self [:event :arg]) ;;no server
(dispatcher/dispatch :chat/brasil [])
(dispatcher/dispatch [dest-id] [:chat/message {:text "Aê!"}]) =server=> orig-id event-v
(handler :chat/message (fn [db orig-id v] ;; [:chat/message {:text "Aê"}] = v
(dispatcher/dispatch :all [:chat/message {:text text :time}])
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment