1.0.2 • Published 7 years ago
hellewhile v1.0.2
Hellewhile
An awesome while loop implementation for promises.
Usage
Hellewhile is a UMD module, therefore is compatible with both AMD and CommonJS:
import hellewhile from 'hellewhile';
const hellewhile = require('hellewhile');Example Usage
See tests!
hellewhile
An awesome while loop implementation for promises.
- hellewhile
- static
- inner
- ~predicate(results, context) ⇒ Boolean
- ~asyncFn(context) ⇒ Promise.<*>
hellewhile
While loop implementation for an asynchronous function.
| Param | Type | Default | Description |
|---|---|---|---|
| asyncFn | asyncFn | the asynchronous function run with the context object. | |
| predicate | predicate | the predicate function to be used as the while loop conditional. | |
| context | Object | null | optional context object to be passed into the asyncFn and predicate functions. |
| tracker | String | null | optional property to be set on the context object that will store the results of each individual asyncFn call. |
hellewhile~predicate(results, context) ⇒ Boolean
Predicate function to be applied to the results of the asyncFunc.
Returns: Boolean - if true, ends the loop.
| Param | Type | Description |
|---|---|---|
| results | * | results returned from the asyncFn |
| context | Object | null | the context object, null if not passed in. |
hellewhile~asyncFn(context) ⇒ Promise.<*>
Asynchronous function to loop over.
Returns: Promise.<*> - results of the asynchronous call
| Param | Type | Description |
|---|---|---|
| context | Object | null | the context object, null if not passed in. |
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago
0.0.16
7 years ago
0.0.15
7 years ago
0.0.14
7 years ago
0.0.13
7 years ago
0.0.12
7 years ago
0.0.11
7 years ago
0.0.10
7 years ago
0.0.9
7 years ago
0.0.8
7 years ago
0.0.7
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago
