Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
manage callbacks, deferreds and resources with style
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
test
README.rest

README.rest

intercaljs - manage callbacks and deferreds with style

you discovered $.ajax, $.Deferred and maybe $.Callbacks and started using them to handle the async world of a webapp.

after a while your ajax calls, callbacks and deferreds are all over the place and the code is a mess.

It's hard to know the kind of events your application generates and sometimes you don't have access to them from where you are.

There is no single place to go look for the list of events and deferreds.

There is no single place to go look at the URLs for the ajax requests. You change an API endpoint in the server and have to edit it in multiple places in the client since you ajax calls are scattered in the code

There is no structure or convention on them.

you need to wait for some deferreds and/or callbacks and start doing callback accounting by hand.

sounds familiar?

if so, then intercaljs is for you.

what is it?

intercaljs is a small jquery library that allows organizing your events, resources, URLs and deferreds in one place, hierarchically.

it also provides utilities to wait for a set of events/deferreds in a unified and clean way, for example:

  • wait for the first event/deferred
  • wait for N
  • wait for all
  • wait with timeout
  • listen to any or all child events/deferreds from a given node in the hierarchy

get it

git clone https://github.com/marianoguerra/intercaljs

learn more

http://marianoguerra.github.com/intercaljs/

test it

http://marianoguerra.github.com/intercaljs/test

or open test/index.html in your browser

author

Mariano Guerra

license

BSD (+ optional beer to the author)

Something went wrong with that request. Please try again.