Skip to content

bmarti44/jQuery-Simple-Defer

Repository files navigation

Simple jQuery Defer

What is it?

This is a simple jQuery Plugin for replicating Underscore.js's _.defer functionality (with a couple of extra parameters).

Note: for more complicated use cases with deferred you'll probably want to use jQuery's deferred API http://api.jquery.com/category/deferred-object/

Example

	$.defer({
	    'async': deferTest, /* the function to execute asynchronously */
	    'async_arguments': ['1', '2', '3'], /* the arguments to pass to the asynchronous function, formatted as an array */ 
	    'callback': deferComplete, /* the function you'd like to call after the asynchronous function completes */
	    'callback_arguments': ['1', '2', '3'] /* the arguments you'd like to pass to your callback */
	});

http://jsfiddle.net/rCwen/4/

About

Similar to Underscore.js _.defer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published