flinker 1.0.0 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,74 @@
1
+ var RXSubscriber = /** @class */ (function () {
2
+ function RXSubscriber(pipeline) {
3
+ this._isComplete = false;
4
+ this.isSubscribed = false;
5
+ this.pipeline = pipeline;
6
+ }
7
+ Object.defineProperty(RXSubscriber.prototype, "isComplete", {
8
+ get: function () { return this._isComplete; },
9
+ enumerable: false,
10
+ configurable: true
11
+ });
12
+ RXSubscriber.prototype.send = function (value, broadcast) {
13
+ var _a;
14
+ if (!this._isComplete) {
15
+ (_a = this.onReceiveCallback) === null || _a === void 0 ? void 0 : _a.call(this, value);
16
+ }
17
+ };
18
+ RXSubscriber.prototype.sendError = function (e, broadcast) {
19
+ var _a;
20
+ if (!this._isComplete) {
21
+ (_a = this.onErrorCallback) === null || _a === void 0 ? void 0 : _a.call(this, e);
22
+ }
23
+ };
24
+ RXSubscriber.prototype.sendComplete = function (broadcast) {
25
+ var _a;
26
+ if (!this._isComplete) {
27
+ this._isComplete = true;
28
+ (_a = this.onCompleteCallback) === null || _a === void 0 ? void 0 : _a.call(this);
29
+ this.unsubscribe();
30
+ }
31
+ };
32
+ RXSubscriber.prototype.onReceive = function (f) {
33
+ if (this.isComplete)
34
+ throw new Error('RXSubscriber is complete: It can update onReceiveCallback');
35
+ else if (this.isSubscribed)
36
+ throw new Error('RXSubscriber can not update onReceiveCallback: subscribe() is already evoked');
37
+ this.onReceiveCallback = f;
38
+ return this;
39
+ };
40
+ RXSubscriber.prototype.onError = function (f) {
41
+ if (this.isComplete)
42
+ throw new Error('RXSubscriber is complete: It can not update onErrorCallback');
43
+ else if (this.isSubscribed)
44
+ throw new Error('RXSubscriber can not update onErrorCallback: subscribe() is already evoked');
45
+ this.onErrorCallback = f;
46
+ return this;
47
+ };
48
+ RXSubscriber.prototype.onComplete = function (f) {
49
+ if (this.isComplete)
50
+ throw new Error('RXSubscriber is complete: It can not update onCompleteCallback');
51
+ else if (this.isSubscribed)
52
+ throw new Error('RXSubscriber can not update onCompleteCallback: subscribe() is already evoked');
53
+ this.onCompleteCallback = f;
54
+ return this;
55
+ };
56
+ RXSubscriber.prototype.subscribe = function () {
57
+ var _this = this;
58
+ if (this.isSubscribed)
59
+ throw new Error('RXPipeline has already a subscriber');
60
+ this.isSubscribed = true;
61
+ this.pipeline.dispatcher.didSubscribe(this.pipeline);
62
+ return function () {
63
+ _this.unsubscribe();
64
+ };
65
+ };
66
+ RXSubscriber.prototype.unsubscribe = function () {
67
+ this.onReceiveCallback = undefined;
68
+ this.onErrorCallback = undefined;
69
+ this.onCompleteCallback = undefined;
70
+ this.pipeline.dispatcher.didUnsubscribe(this.pipeline);
71
+ };
72
+ return RXSubscriber;
73
+ }());
74
+ export { RXSubscriber };
@@ -0,0 +1,252 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ export var asyncDelay = function (time) { return __awaiter(void 0, void 0, void 0, function () {
38
+ var p;
39
+ return __generator(this, function (_a) {
40
+ switch (_a.label) {
41
+ case 0:
42
+ p = new Promise(function (resolve) {
43
+ setTimeout(function () {
44
+ resolve('done!');
45
+ }, time);
46
+ });
47
+ return [4 /*yield*/, p];
48
+ case 1: return [2 /*return*/, _a.sent()];
49
+ }
50
+ });
51
+ }); };
52
+ export var MD5 = function (string) {
53
+ function RotateLeft(lValue, iShiftBits) {
54
+ return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
55
+ }
56
+ function AddUnsigned(lX, lY) {
57
+ var lX4, lY4, lX8, lY8, lResult;
58
+ lX8 = (lX & 0x80000000);
59
+ lY8 = (lY & 0x80000000);
60
+ lX4 = (lX & 0x40000000);
61
+ lY4 = (lY & 0x40000000);
62
+ lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
63
+ if (lX4 & lY4) {
64
+ return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
65
+ }
66
+ if (lX4 | lY4) {
67
+ if (lResult & 0x40000000) {
68
+ return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
69
+ }
70
+ else {
71
+ return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
72
+ }
73
+ }
74
+ else {
75
+ return (lResult ^ lX8 ^ lY8);
76
+ }
77
+ }
78
+ function F(x, y, z) { return (x & y) | ((~x) & z); }
79
+ function G(x, y, z) { return (x & z) | (y & (~z)); }
80
+ function H(x, y, z) { return (x ^ y ^ z); }
81
+ function I(x, y, z) { return (y ^ (x | (~z))); }
82
+ function FF(a, b, c, d, x, s, ac) {
83
+ a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
84
+ return AddUnsigned(RotateLeft(a, s), b);
85
+ }
86
+ function GG(a, b, c, d, x, s, ac) {
87
+ a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
88
+ return AddUnsigned(RotateLeft(a, s), b);
89
+ }
90
+ function HH(a, b, c, d, x, s, ac) {
91
+ a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
92
+ return AddUnsigned(RotateLeft(a, s), b);
93
+ }
94
+ function II(a, b, c, d, x, s, ac) {
95
+ a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
96
+ return AddUnsigned(RotateLeft(a, s), b);
97
+ }
98
+ function ConvertToWordArray(string) {
99
+ var lWordCount;
100
+ var lMessageLength = string.length;
101
+ var lNumberOfWords_temp1 = lMessageLength + 8;
102
+ var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64;
103
+ var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
104
+ var lWordArray = Array(lNumberOfWords - 1);
105
+ var lBytePosition = 0;
106
+ var lByteCount = 0;
107
+ while (lByteCount < lMessageLength) {
108
+ lWordCount = (lByteCount - (lByteCount % 4)) / 4;
109
+ lBytePosition = (lByteCount % 4) * 8;
110
+ lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
111
+ lByteCount++;
112
+ }
113
+ lWordCount = (lByteCount - (lByteCount % 4)) / 4;
114
+ lBytePosition = (lByteCount % 4) * 8;
115
+ lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
116
+ lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
117
+ lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
118
+ return lWordArray;
119
+ }
120
+ function WordToHex(lValue) {
121
+ var WordToHexValue = '';
122
+ var WordToHexValue_temp = '';
123
+ var lByte;
124
+ var lCount;
125
+ for (lCount = 0; lCount <= 3; lCount++) {
126
+ lByte = (lValue >>> (lCount * 8)) & 255;
127
+ WordToHexValue_temp = '0' + lByte.toString(16);
128
+ WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
129
+ }
130
+ return WordToHexValue;
131
+ }
132
+ function Utf8Encode(string) {
133
+ string = string.replace(/\r\n/g, '\n');
134
+ var utftext = '';
135
+ for (var n = 0; n < string.length; n++) {
136
+ var c_1 = string.charCodeAt(n);
137
+ if (c_1 < 128) {
138
+ utftext += String.fromCharCode(c_1);
139
+ }
140
+ else if ((c_1 > 127) && (c_1 < 2048)) {
141
+ utftext += String.fromCharCode((c_1 >> 6) | 192);
142
+ utftext += String.fromCharCode((c_1 & 63) | 128);
143
+ }
144
+ else {
145
+ utftext += String.fromCharCode((c_1 >> 12) | 224);
146
+ utftext += String.fromCharCode(((c_1 >> 6) & 63) | 128);
147
+ utftext += String.fromCharCode((c_1 & 63) | 128);
148
+ }
149
+ }
150
+ return utftext;
151
+ }
152
+ var x = [];
153
+ var k, AA, BB, CC, DD, a, b, c, d;
154
+ var S11 = 7;
155
+ var S12 = 12;
156
+ var S13 = 17;
157
+ var S14 = 22;
158
+ var S21 = 5;
159
+ var S22 = 9;
160
+ var S23 = 14;
161
+ var S24 = 20;
162
+ var S31 = 4;
163
+ var S32 = 11;
164
+ var S33 = 16;
165
+ var S34 = 23;
166
+ var S41 = 6;
167
+ var S42 = 10;
168
+ var S43 = 15;
169
+ var S44 = 21;
170
+ string = Utf8Encode(string);
171
+ x = ConvertToWordArray(string);
172
+ a = 0x67452301;
173
+ b = 0xEFCDAB89;
174
+ c = 0x98BADCFE;
175
+ d = 0x10325476;
176
+ for (k = 0; k < x.length; k += 16) {
177
+ AA = a;
178
+ BB = b;
179
+ CC = c;
180
+ DD = d;
181
+ a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
182
+ d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
183
+ c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
184
+ b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
185
+ a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
186
+ d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
187
+ c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
188
+ b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
189
+ a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
190
+ d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
191
+ c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
192
+ b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
193
+ a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
194
+ d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
195
+ c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
196
+ b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
197
+ a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
198
+ d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
199
+ c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
200
+ b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
201
+ a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
202
+ d = GG(d, a, b, c, x[k + 10], S22, 0x2441453);
203
+ c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
204
+ b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
205
+ a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
206
+ d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
207
+ c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
208
+ b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
209
+ a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
210
+ d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
211
+ c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
212
+ b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
213
+ a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
214
+ d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
215
+ c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
216
+ b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
217
+ a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
218
+ d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
219
+ c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
220
+ b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
221
+ a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
222
+ d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
223
+ c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
224
+ b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
225
+ a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
226
+ d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
227
+ c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
228
+ b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
229
+ a = II(a, b, c, d, x[k + 0], S41, 0xF4292244);
230
+ d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
231
+ c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
232
+ b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
233
+ a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
234
+ d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
235
+ c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
236
+ b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
237
+ a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
238
+ d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
239
+ c = II(c, d, a, b, x[k + 6], S43, 0xA3014314);
240
+ b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
241
+ a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
242
+ d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
243
+ c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
244
+ b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
245
+ a = AddUnsigned(a, AA);
246
+ b = AddUnsigned(b, BB);
247
+ c = AddUnsigned(c, CC);
248
+ d = AddUnsigned(d, DD);
249
+ }
250
+ var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d);
251
+ return temp.toLowerCase();
252
+ };
@@ -0,0 +1,7 @@
1
+ export { RX, } from "./RX.js";
2
+ export { RXPublisher, RXJustComplete, RXJustError, RXDelayedComplete, RXDelayedError, RXEmitter, RXSubject, RXBuffer, RXOperation, RXCombine, RXFrom, RXWaitUntilComplete, RXObservableEntity, RXObservableValue, RXQueueOperator, RXQueue, } from "./RXPublisher.js";
3
+ export { observe, observeFrom, observer, JSXSubscriber, ObservableGlobalState, RenderQueueStatus, } from "./RXObserver.js";
4
+ export { RXOperator, RXMap, RXFlatMap, RXForEach, RXSequent, RXParallel, RXFilter, RXSpread, RXSkipFirst, RXSkipNullable, RXRemoveDuplicates, RXDebounce, RXReplaceError, } from "./RXOperator.js";
5
+ export { RXPipeline } from "./RXPipeline.js";
6
+ export { RXSubscriber } from "./RXSubscriber.js";
7
+ export { MD5, asyncDelay } from "./Utils.js";
@@ -0,0 +1,7 @@
1
+ export { RXAnySender, RXSender, RX, } from "./RX.js";
2
+ export { AnyRXObservable, RXObservable, RXPublisherUID, RXPublisher, RXJustComplete, RXJustError, RXDelayedComplete, RXDelayedError, RXEmitter, RXSubject, RXBuffer, RXOperation, RXCombine, RXFrom, RXWaitUntilComplete, RXObservableEntity, RXObservableValue, RXAnyQueueOperator, RXQueueOperator, RXQueue, } from "./RXPublisher.js";
3
+ export { observe, observeFrom, observer, JSXSubscriber, ObservableGlobalState, RenderQueueStatus, } from "./RXObserver.js";
4
+ export { RXOperatorProtocol, RXAnyOperator, RXOperator, RXMap, RXFlatMap, RXForEach, RXSequent, RXParallel, RXFilter, RXSpread, RXSkipFirst, RXSkipNullable, RXRemoveDuplicates, RXDebounce, RXReplaceError, } from "./RXOperator.js";
5
+ export { RXAnyPipeline, RXPipeline } from "./RXPipeline.js";
6
+ export { ErrorMethod, CompleteMethod, SubscribeMethod, RXAnySubscriber, RXSubscriber } from "./RXSubscriber.js";
7
+ export { MD5, asyncDelay } from "./Utils.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "flinker",
3
- "description": "RX lib for building frontend apps",
4
- "version": "1.0.0",
3
+ "description": "RX.ts lib for building frontend apps",
4
+ "version": "1.0.6",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/Dittner/Flinker.git"