Skip to content

kakusuke/jquery-deferred-util

Repository files navigation

Deferred Util

Build Status

Deferred Utility

Getting Started

Download the production version or the development version.

In your web page:

<script src="jquery.js"></script>
<script src="dist/deferred-util.min.js"></script>
<script>
jQuery(function($) {
  // Like setTimeout,
  $.wait(100).done(function() {
    // this callback called after 100ms.
  });


  var sequence = $.Sequence();

  // You can define steps, which are called added order.
  sequence.add(function() {
    // first.
    // The return value delays next step call
    return $.get('/foo.json').done(function() { /* process.. */ });
  });
  sequence.add(function() {
    // second.
    return $.get('/bar.json').done(function() { /* process.. */ });
  });
  sequence.add(function() {
    // third.
    return $.get('/buz.json').done(function() { /* process.. */ });
  });

  sequence.play();

});
</script>

Documentation

(Coming soon)

Examples

(Coming soon)

Release History

(Nothing yet)

About

No description, website, or topics provided.

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published