oakmac / open-ideas

a Place to Store Ideas
2 stars 0 forks source link

ClojureScript AJAX Library #8

Closed oakmac closed 8 years ago

oakmac commented 8 years ago

AJAX is a common activity in web development. The Google Closure Library has a library for handling AJAX, but the API is verbose and not well-suited to ClojureScript's functional style.

Additionally, a common use case for AJAX in ClojureScript is fetching JSON and converting it into ClojureScript's persistent data structures. transit-cljs is the best way to do this, being significantly faster than js->clj.

It would be nice to have a small library to wrap Google Closure AJAX + transit-cljs into a small interface similar to jQuery's excellent ajax method.

oakmac commented 8 years ago

I added a fetch-json-as-clj function to oakmac.util in v3.0.0

I think for anything more complex than that, cljs-ajax or using $.ajax() interop directly should work fine.