Skip to content

Instantly share code, notes, and snippets.

@canonic-epicure
Created September 12, 2011 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save canonic-epicure/1210985 to your computer and use it in GitHub Desktop.
Save canonic-epicure/1210985 to your computer and use it in GitHub Desktop.
t.simulateDrag(el, 10, 10).then(function (cont) {
store.doXHRRequest({
callback : function () {
cont.CONTINUE('result')
// or just
cont('result')
},
errback : function (err) {
cont.THROW(err)
}
})
}).then(function (cont, result) {
result == 'result' // received from previous segment
// in general, do you stuff asynchronously,
// then call the cont.CONTINUE(result) or cont(result) when done
// or cont.THROW(error) in case of any error
cont.CONTINUE()
}).then(...)
// optional - CATCH/FINALLY sections:
.except(function (cont) {
}).ensure(function (cont) {
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment