sta

stager

Not another promise library

Showing:

Popularity

Downloads/wk

1

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Stager

Because you need to do a lot of asynchronous requests, that you watch to proccess in batches and you don't want to use a huge promise library.

Instead you may prefer a more data-centric approach.

Install

npm install stager

Await

    Stager.await({
      pizza: my_awesome_async_function( "tasty", 200 ),
      kebab: my_awesome_async_function( "yuck", 400 ),
      nested_stuff:{
        some_string: "Hello",
        another_function: my_awesome_async_function("Yes i am a function", 300)
      }

    }, function( err ){
        // after about 400 ms this will be executed 
        console.log( this.pizza );
        console.log( this.kebab );
        console.log( this.nested_stuff.some_string );
    });

Make a stage

    var stager = Stager.make();
    stager( function(){
      this.pizza = my_awesome_async_function( "tasty", 200 );
      this.kebab = my_awesome_async_function( "yuck", 200 );
      this.hamburger = my_awesome_async_function( "yuck", 200 );
    });
    stager( function(){
        // gets executed about 200 ms later
        console.log( this.pizza );
        console.log( this.kebab );
    });

Clocking it

  # Calling await
    ✓ Testing await (403ms)

  # Setting a stage
    ✓ Staging 2 stages (208ms)

Testing

npm test

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100