activity-queue
Advanced tools
Comparing version 0.0.0 to 1.0.0
{ | ||
"name": "activity-queue", | ||
"version": "0.0.0", | ||
"version": "1.0.0", | ||
"description": "Easily track activity and when that activity flushes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,7 +12,32 @@ # activity-queue | ||
``` js | ||
const flush-queue = require('flush-queue') | ||
const ActivityQueue = require('activity-queue') | ||
const queue = new ActivityQueue() | ||
const clock = queue.active() | ||
const drained = queue.drained() | ||
// await drained to know when its drained | ||
queue.inactive(clock) | ||
``` | ||
## API | ||
#### `clock = queue.active()` | ||
Mark the queue as active. Returns the activity clock as an integer. | ||
#### `queue.inactive(clock)` | ||
Mark the activity done by passing the clock back. | ||
#### `promise = queue.drained()` | ||
Wait for the queue to drain. It's snapshot to the current state | ||
so any future activity events do not not count. | ||
## License | ||
MIT | ||
Apache-2.0 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
15565
0
43