2.2.4 • Published 2 months ago

@code-like-a-carpenter/wait-for v2.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@code-like-a-carpenter/wait-for

standard-readme compliant

Waits for a function to successfully resolve, within a given timeout.

Table of Contents

Install

npm i @code-like-a-carpenter/wait-for

Usage

import {waitFor} from '@code-like-a-carpenter/wait-for';

const result = await waitFor(async () => {
    return await loadSlowThingFromTheDatabase();
}, 20000);

const validatedResult = await waitFor(async () => {
    const item = await loadSlowThingFromTheDatabase();
    expect(item).toBeDefined();
    expect(item.id).toBe(1);
    return item;
}, 20000);

Maintainer

Ian Remmel

Contributing

Please see contributing guidelines at the project homepage.

License

MIT © Ian Remmel 2023 until at least now

2.2.3

2 months ago

2.2.4

2 months ago

2.2.2

2 months ago

2.2.1

3 months ago

2.2.0

3 months ago

2.1.0

3 months ago

2.0.0

4 months ago

1.0.4

9 months ago

1.0.2

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago