Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

but-wait

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

but-wait

but wait, there is more! run parallel tasks synchronously after initializing but before starting your application


Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 20 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc