You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This manager helps you to handle multiple promises effortlessly. This library will handle processes and its sub processes and its sub process and so on...
3
+
4
+
## Simplest Code
5
+
```js
6
+
var processQueue =newProcessQueue;
7
+
var process1 =newProcess(function(){/* promise invoker function */});
8
+
processQueue.push(process1);
9
+
var process2...
10
+
var process3 ...
11
+
```
12
+
13
+
## Developers
14
+
**Build dist**
15
+
Just a simple node program run on build.js file.
16
+
* Make sure you have npm and node installed. If not [click here](https://nodejs.org/en/download/)
- invokingFunction → function that should be invoked inside the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
35
+
- promise → or [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) object itself
36
+
- title → initial title to display on [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)
37
+
38
+
**Methods**
39
+
40
+
```js
41
+
appendToElement(DOMElement);
42
+
```
43
+
- DOMElement → to attach the Process UI to a [DOMElement](https://developer.mozilla.org/en-US/docs/Web/API/Element)
44
+
45
+
```js
46
+
then(resolve,reject);
47
+
```
48
+
- resolve, reject → functions that we pass to a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
49
+
50
+
```js
51
+
catch(reject);
52
+
```
53
+
- reject → function that we pass to a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
54
+
55
+
```js
56
+
updateTitle(title);
57
+
```
58
+
- updates the title in the [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)
59
+
60
+
61
+
## ProcessQueue
62
+
63
+
**Syntax**
64
+
65
+
```js
66
+
newProccessQueue([title]);
67
+
```
68
+
- title → initial title to display on [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)
69
+
70
+
**Methods**
71
+
72
+
```js
73
+
appendToElement(DOMElement);
74
+
```
75
+
- DOMElement → to attach the ProcessQueue to a [DOMElement](https://developer.mozilla.org/en-US/docs/Web/API/Element)
76
+
77
+
```js
78
+
push(Process);
79
+
push(ProcessQueue);
80
+
```
81
+
- any `Process` or `ProcessQueue` type of object can be pushed into the queue
82
+
83
+
```js
84
+
then(resolve,reject);
85
+
```
86
+
- resolve, reject → functions that we pass to a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
87
+
88
+
```js
89
+
catch(reject);
90
+
```
91
+
- reject → function that we pass to a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
92
+
93
+
```js
94
+
updateTitle(title);
95
+
```
96
+
- updates the title in the [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)
0 commit comments