Skip to content

Instantly share code, notes, and snippets.

@randallb
Last active December 17, 2015 21:09
Show Gist options
  • Save randallb/5672932 to your computer and use it in GitHub Desktop.
Save randallb/5672932 to your computer and use it in GitHub Desktop.
sc = new RC.shortcut;
sc.queue(function(chain){
chain.take()
chain.load()
chain.dothing()
})
// chain just adds that to a queue, and when the fn returns, you execute the queue in order.
sc.take() // should execute immediately and return a promise.
/*
potential bug w/ your api:
request 1-> queue something, load x, hit a database, get result, insert result into tricaster, send()
request 2-> load y, send()
actual result -> queue something, load x, load y, send()
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment