At the moment I have this: (let [ client (js/Client. ) connectOptions (new js/Object) ] (.onSuccess connectOptions ) (fn [] (js/console.log "Successful Connect")) (.onFailure connectOptions ) (fn [] (js/console.log "failure Connect")))
If you need any more info please let me know. Thomas On Tuesday, November 20, 2012 4:07:12 PM UTC, David Nolen wrote: > > What does your ClojureScript code look like? > > > On Tue, Nov 20, 2012 at 5:47 AM, Thomas <th.van...@gmail.com <javascript:> > > wrote: > >> Hi, >> >> I am trying to use an existing JS library from CLJS and in JS one needs >> to define some call back functions in the following way. Assuming you have >> written some functions "foo" and "bar" and you have created a client called >> "client", you can do: >> var options = new Object(); >> options.onSuccess = foo; >> options.onFailure = bar; >> client.connect(options); >> >> What would be the equivalent in CLJS? When I create a new Object I get >> the following error when I try and run the code: >> >> Uncaught TypeError: Object #<Object> has no method 'onSuccess' >> >> Which is of course not that surprising... But how to do this properly in >> CLJS? >> >> TIA >> Thomas >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clo...@googlegroups.com<javascript:> >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+u...@googlegroups.com <javascript:> >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en > > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en