The idea is fairly simple. You build your callback library, when something happens on a node, then it fires a list of callbacks with some specific arguments.
Declaration of callbacks looks like this:
<div data-callback="firstCallback('arg1', ..., 'argN'); secondCallback('arg1')"></div>
Now you can do some operation on such node and after it finishes fire a series of declared callbacks. Please check JSFiddle example below:
Maybe I’ll wrap this in some kind of nice library and put it on Github. Anyone interested? Fell free to comment.