@strong-roots-capital/until
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

until Build status npm version codecov

Await until event

Compatible with

Install

npm install @strong-roots-capital/until

Use

import { until } from '@strong-roots-capital/until'

test('should await until event', async t => {
    class TestClient extends EventEmitter {
        open = false
        constructor() {
            super()
            setTimeout(() => {
                this.open = true
                this.emit('open')
            }, 100)
        }
    }
    const client = new TestClient()
    await until(client, 'open')
    t.true(client.open)
})

Related

Readme

Keywords

Package Sidebar

Install

npm i @strong-roots-capital/until

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

7.27 kB

Total Files

4

Last publish

Collaborators

  • amchelle
  • hamroctopus