1.0.1 • Published 5 years ago

@strong-roots-capital/until v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

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

1.0.1

5 years ago

1.0.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago