Skip to content

gilbertw1/cljs-asynchronize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cljs-asynchronize

Asynchronize is a clojurescript macro that allows you to wrap arbitary blocks of code to execute that will treat functions requiring callbacks as first class functions. This allows clojure code to be written in a serial fashion without having to nest callback functions.

Installation

In order to use Asynchronize you must import both core.async, the go macro, and the asynchronize macro itself.

(:require [cljs.core.async])
(:require-macros [cljs-asynchronize.macros :as dm :refer [asynchronize]]
                 [cljs.core.async.macros :as am :refer [go]]))

Usage

Use the 'asynchronize' macro to wrap blocks of code which contain callback based functions, replacing the callback parameter with an elipsis '...':

(asynchronize
  (def res (.get http "http://www.google.com" ...))
  (console/log res))

More examples can be found in examples

About

Asynchronizes Yo Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published