flinker 1.0.0 → 1.0.5
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.
- package/dist/RX.d.ts +22 -0
- package/dist/RXObserver.d.ts +33 -0
- package/dist/RXOperator.d.ts +133 -0
- package/dist/RXPipeline.d.ts +14 -0
- package/dist/RXPublisher.d.ts +153 -0
- package/dist/RXSubscriber.d.ts +30 -0
- package/dist/cjs/RX.js +41 -0
- package/dist/cjs/RXObserver.js +255 -0
- package/dist/cjs/RXOperator.js +484 -0
- package/dist/cjs/RXPipeline.js +27 -0
- package/dist/cjs/RXPublisher.js +733 -0
- package/dist/cjs/RXSubscriber.js +77 -0
- package/dist/cjs/index.js +50 -0
- package/dist/esm/RX.js +38 -0
- package/dist/esm/RXObserver.js +249 -0
- package/dist/esm/RXOperator.js +481 -0
- package/dist/esm/RXPipeline.js +24 -0
- package/dist/esm/RXPublisher.js +730 -0
- package/dist/esm/RXSubscriber.js +74 -0
- package/dist/esm/index.js +7 -0
- package/dist/index.d.ts +7 -0
- package/package.json +2 -2
|
@@ -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,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";
|
package/dist/index.d.ts
ADDED
|
@@ -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.
|
|
3
|
+
"description": "RX.ts lib for building frontend apps",
|
|
4
|
+
"version": "1.0.5",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/Dittner/Flinker.git"
|