1.0.0 • Published 5 years ago

but-wait v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

but-wait

but-wait allows to synchronize initialization tasks across your application easily.

Installation

Install with npm:

npm i --save but-wait

Install with yarn:

yarn add but-wait

Example

// component.js
import butWait from "but-wait";

butWait.thereIsMore(
    fetch("some/important/data")
        .then(data =>  processData(data))
)


// main.js
import butWait from "but-wait";

butWait.noMore().then(() => {
    //important data is fetched and processed
    startApplication()
})

Documentation

thereIsMore(more)

add a task that should be run before. Can not be called after noMore() was called.

ArgumentTypeDescription
more<function:<Promise>> or <Promise>can be either a Promise or a function that returns a Promise.

noMore()

can only be called once

ArgumentTypeDescription
returns<Promise>resolved after all Promises in the stack are resolved

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

TODO-List

  • add namespaces
  • add tests

License

MIT

1.0.0

5 years ago

0.4.0

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago