task-handler
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "task-handler", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Handle Javascript Timers in a manageable way", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -77,2 +77,36 @@ # task-handler | ||
## Common Type Signatures | ||
Below are a few of the common type signatures describing the values which are | ||
used throughout the API for `task-handler`. | ||
```js | ||
type TaskID = string; | ||
type TaskCancelFunction = () => boolean; | ||
type TaskTypes = | ||
| 'timeout' | ||
| 'timeouts' | ||
| 'intervals' | ||
| 'interval' | ||
| 'defer' | ||
| 'defers'; | ||
type TaskID = string; | ||
type TaskCancelFunction = () => boolean; | ||
type WhileConditionFn = (ref: CallbackRef, ...args: Array<*>) => boolean; | ||
type CallbackRef = {| | ||
+task: TaskHandler, | ||
+id: TaskID, | ||
+cancel: TaskCancelFunction, | ||
+while: (condition: WhileConditionFn) => void, | ||
|}; | ||
type CallbackFn = (ref: CallbackRef, ...args: Array<*>) => mixed; | ||
``` | ||
## API Reference | ||
@@ -152,18 +186,1 @@ | ||
``` | ||
### `TaskRef` (Object) | ||
```js | ||
type TaskID = string; | ||
type TaskCancelFunction = () => boolean; | ||
type WhileConditionFn = (ref: CallbackRef, ...args: Array<*>) => boolean; | ||
type CallbackRef = {| | ||
+task: TaskHandler, | ||
+id: TaskID, | ||
+cancel: TaskCancelFunction, | ||
+while: (condition: WhileConditionFn) => void, | ||
|}; | ||
``` |
19549
185