Skip to content

Spine.Ajax & AwaitAjax for Spine.JS and Iced CoffeeScript await/defer pattern

Notifications You must be signed in to change notification settings

nextorigin/spine-awaitajax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spine-awaitajax

Build Status Coverage Status Dependency Status devDependency Status Downloads Greenkeeper badge

Turns Spine/jQuery Ajax requests into single-callback form, for use with await/defer

NPM

What?

Iced CoffeeScript and tamejs offer the await/defer construct that lends itself well to the node-style async pattern callback(err, response), particularly when using a construct like errify/make_esc from iced error.

awaitajax lets you have your await and easy jQuery.ajax() -style options too. By building on iced, AJAX calls can be easily handled in one line.

Example

Regular

await Ajax.awaitGet {url: "https://www.google.com"}, defer err, response

Serial

await Ajax.awaitQueuedGet {url: "https://www.google.com"}, defer err, response
await Ajax.awaitQueuedGet {url: "http://siteaftergoogle.com"}, defer err, response

License

MIT

Releases

No releases published

Packages

No packages published