An open API service indexing awesome lists of open source software.

https://github.com/little-core-labs/hypercore-ready

Wait for 1 more or more hypercores to be ready.
https://github.com/little-core-labs/hypercore-ready

callback hypercore ready

Last synced: 6 months ago
JSON representation

Wait for 1 more or more hypercores to be ready.

Awesome Lists containing this project

README

          

hypercore-ready
===============

> Wait for 1 more or more hypercores to be ready.

## Installation

```sh
$ npm install hypercore-ready --save
```

## Usage

```js
const ready = require('hypercore-ready')

ready(...hypercores, (err) => {
// called when all hypercores are ready
})
```

## API

### `ready(...hypercores[, callback])`
### `ready(hypercores[, callback])`
### `await ready(hypercores)`

Waits for all given `hypercores` to be ready calling `callback(err,
pending, total)` when all are ready or when an error occurs.

```js
const cores = [ ...hypercores ]

ready(...cores, callback)
// or
ready(cores)
// or
await ready(cores)
```

## License

MIT