1.0.2 • Published 8 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
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago
0.0.16
8 years ago
0.0.15
8 years ago
0.0.14
8 years ago
0.0.13
8 years ago
0.0.12
8 years ago
0.0.11
8 years ago
0.0.10
8 years ago
0.0.9
8 years ago
0.0.8
8 years ago
0.0.7
8 years ago
0.0.6
8 years ago
0.0.5
8 years ago
0.0.4
8 years ago
0.0.3
8 years ago
0.0.2
8 years ago
0.0.1
8 years ago
