evg_observable 2.15.4 → 2.15.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/README.md +40 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ EVG Observable - is a light library for simple use.
|
|
|
8
8
|
|
|
9
9
|
## Navigation
|
|
10
10
|
|
|
11
|
+
- [EVG Observable vs RxJS](#evg-observable-vs-rxjs)
|
|
11
12
|
- [What is EVG Observable?](#what-is-evg-observable)
|
|
12
13
|
- [Installation](#installation)
|
|
13
14
|
- [Node.js](#nodejs)
|
|
@@ -29,6 +30,45 @@ EVG Observable - is a light library for simple use.
|
|
|
29
30
|
- [Collector](#collector-1)
|
|
30
31
|
- [License](#license)
|
|
31
32
|
|
|
33
|
+
## EVG Observable vs RxJS
|
|
34
|
+
|
|
35
|
+
| Metric | EVG Observable | RxJS |
|
|
36
|
+
|--------|----------------|------|
|
|
37
|
+
| **Bundle size** | **6.4 kB** | 88 kB |
|
|
38
|
+
| **Size advantage** | **13.75x smaller** | - |
|
|
39
|
+
| **Operations** | ~40 | 100+ |
|
|
40
|
+
| **Performance** | **2-6x faster** | baseline |
|
|
41
|
+
|
|
42
|
+
### Performance Comparison (Bundle vs Bundle)
|
|
43
|
+
|
|
44
|
+
| Test | EVG Observable | RxJS | Advantage |
|
|
45
|
+
|------|----------------|------|-----------|
|
|
46
|
+
| Emit 100 values | 1,548K ops/sec | 240K ops/sec | **6.4x faster** |
|
|
47
|
+
| Filter + transform | 353K ops/sec | 164K ops/sec | **2.1x faster** |
|
|
48
|
+
| 10 subscribers | 9,078K ops/sec | 2,900K ops/sec | **3.1x faster** |
|
|
49
|
+
| 100 subscribers | 1,245K ops/sec | 336K ops/sec | **3.7x faster** |
|
|
50
|
+
| 1000 subscribers | 122K ops/sec | 33K ops/sec | **3.7x faster** |
|
|
51
|
+
| Large payload | 865K ops/sec | 199K ops/sec | **4.3x faster** |
|
|
52
|
+
|
|
53
|
+
### EVG Observable Advantages
|
|
54
|
+
|
|
55
|
+
- **Dual filtering system** - Inbound (`addFilter`) + Outbound (`pipe`) filters
|
|
56
|
+
- **OR-logic in pipes** - `switch().case()` for branching logic
|
|
57
|
+
- **OR-logic in inbound filters** - `addFilter().switch().case()`
|
|
58
|
+
- **Observable-to-Observable subscription** - Direct subscription without adapters
|
|
59
|
+
- **OrderedObservable** - Subscribers with emission order control (not in RxJS)
|
|
60
|
+
- **Batch emission** - `stream()` method for array processing
|
|
61
|
+
- **Collector** - Convenient subscription management
|
|
62
|
+
- **Clean code organization** - Simple, readable module structure
|
|
63
|
+
|
|
64
|
+
### When to use RxJS instead
|
|
65
|
+
|
|
66
|
+
RxJS is better when you need specialized operators like `debounceTime`, `throttleTime`, `switchMap`, `mergeMap`, `combineLatest`, `withLatestFrom`, or schedulers for async control.
|
|
67
|
+
|
|
68
|
+
**For 80% of reactive programming tasks, EVG Observable provides sufficient functionality with significant performance and size benefits.**
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
32
72
|
## What is EVG Observable?
|
|
33
73
|
|
|
34
74
|
EVG Observable is a robust, lightweight library designed for handling asynchronous events. What sets it apart is its
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "evg_observable",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.5",
|
|
4
4
|
"description": "Alternative fast and light library version - observable.",
|
|
5
5
|
"main": "src/outLib/index.js",
|
|
6
6
|
"types": "src/outLib/index.d.ts",
|
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
"test": "nyc ./node_modules/.bin/_mocha 'test/**/*.test.ts'",
|
|
12
12
|
"remove": "rm -rf ./src/Libraries; rm -rf ./test; rm .mocharc.json; rm .nyrc.json; rm register.js; rm tsconfig.json",
|
|
13
13
|
"build": "tsc --declaration; npm run remove",
|
|
14
|
-
"benchmark": "ts-node benchmark.ts",
|
|
15
|
-
"benchmark:comparison": "ts-node benchmark-comparison.ts"
|
|
14
|
+
"benchmark": "ts-node benchmarks/benchmark.ts",
|
|
15
|
+
"benchmark:comparison": "ts-node benchmarks/benchmark-comparison.ts",
|
|
16
|
+
"benchmark:browser": "ts-node benchmarks/benchmark-browser-bundle.ts",
|
|
17
|
+
"benchmark:bundles": "ts-node benchmarks/benchmark-bundles.ts"
|
|
16
18
|
},
|
|
17
19
|
"repository": {
|
|
18
20
|
"type": "git",
|