Skip to content

marianoguerra/intercaljs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 

Repository files navigation

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)

About

manage callbacks, deferreds and resources with style

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published