evg_observable 2.14.61 → 2.15.1

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,70 @@
1
+ # Breaking Changes - Performance Optimizations Branch
2
+
3
+ ## Version 2.15.0
4
+
5
+ ### Internal Field Renaming
6
+
7
+ **Affected field:** `value` renamed to `_value`
8
+
9
+ The internal field storing the current observable value has been renamed from `value` to `_value` to follow TypeScript conventions for protected/private members.
10
+
11
+ **Before:**
12
+ ```typescript
13
+ export class Observable<T> {
14
+ constructor(private value: T) {}
15
+ }
16
+ ```
17
+
18
+ **After:**
19
+ ```typescript
20
+ export class Observable<T> {
21
+ protected _value: T;
22
+ constructor(value: T) {
23
+ this._value = value;
24
+ }
25
+ }
26
+ ```
27
+
28
+ **Migration:**
29
+ - If you were extending `Observable` and accessing `this.value`, change to `this._value`
30
+ - Use the public `getValue()` method for reading the current value (recommended)
31
+
32
+ ### Visibility Changes
33
+
34
+ The following fields changed from `private` to `protected` to enable better inheritance:
35
+
36
+ | Field | Before | After |
37
+ |-------|--------|-------|
38
+ | `enabled` | private | protected |
39
+ | `filters` | private | protected |
40
+ | `_value` (formerly `value`) | private | protected |
41
+
42
+ **Impact:** This is not a breaking change for most users, but allows subclasses to access these fields.
43
+
44
+ ### Recommended Migration Path
45
+
46
+ Instead of accessing internal fields directly, use the public API:
47
+
48
+ ```typescript
49
+ // Instead of:
50
+ // @ts-ignore
51
+ const val = observable._value;
52
+
53
+ // Use:
54
+ const val = observable.getValue();
55
+
56
+ // Instead of:
57
+ // @ts-ignore
58
+ const count = observable.subs.length;
59
+
60
+ // Use:
61
+ const count = observable.size();
62
+ ```
63
+
64
+ ### New Behavior
65
+
66
+ 1. **`destroy()` now uses `Promise.resolve()`** instead of `setInterval()` for async cleanup when called during emission
67
+ 2. **`unsubscribeAll()` is now safe to call during `next()`** - uses deferred cleanup mechanism
68
+ 3. **Early exit optimization** - `next()` returns immediately if there are no subscribers
69
+
70
+ These behavioral changes improve performance and memory management but should not require code changes.
package/package.json CHANGED
@@ -1,15 +1,18 @@
1
1
  {
2
2
  "name": "evg_observable",
3
- "version": "2.14.61",
3
+ "version": "2.15.1",
4
4
  "description": "Alternative fast and light library version - observable.",
5
5
  "main": "src/outLib/index.js",
6
+ "types": "src/outLib/index.d.ts",
6
7
  "directories": {
7
8
  "test": "test"
8
9
  },
9
10
  "scripts": {
10
11
  "test": "nyc ./node_modules/.bin/_mocha 'test/**/*.test.ts'",
11
12
  "remove": "rm -rf ./src/Libraries; rm -rf ./test; rm .mocharc.json; rm .nyrc.json; rm register.js; rm tsconfig.json",
12
- "build": "tsc --declaration; npm run remove"
13
+ "build": "tsc --declaration; npm run remove",
14
+ "benchmark": "ts-node benchmark.ts",
15
+ "benchmark:comparison": "ts-node benchmark-comparison.ts"
13
16
  },
14
17
  "repository": {
15
18
  "type": "git",
@@ -22,13 +25,17 @@
22
25
  },
23
26
  "homepage": "https://github.com/BarushevEA/light-observable-ts#readme",
24
27
  "devDependencies": {
25
- "typescript": "^5.4.5",
26
28
  "@testdeck/mocha": "^0.3.3",
29
+ "@types/benchmark": "^2.1.5",
27
30
  "@types/chai": "^4.3.4",
31
+ "benchmark": "^2.1.4",
28
32
  "chai": "^4.3.7",
29
- "mocha": "^10.2.0",
30
- "nyc": "^15.1.0",
31
- "ts-node": "^10.9.1"
33
+ "microtime": "^3.1.1",
34
+ "mocha": "^11.7.5",
35
+ "nyc": "^17.1.0",
36
+ "rxjs": "^7.8.2",
37
+ "ts-node": "^10.9.1",
38
+ "typescript": "^5.4.5"
32
39
  },
33
40
  "keywords": [
34
41
  "EVG Observable",
@@ -1,8 +1,37 @@
1
1
  import { ICallback, IChainContainer } from "./Types";
2
+ /**
3
+ * Abstract class representing a Switch-Case control structure for handling
4
+ * conditional chains of operations.
5
+ *
6
+ * @template T - The type of the input payload expected by the conditions.
7
+ * @template P - The type extending IChainContainer, representing the container for the chain of operations.
8
+ * @template W - The type of the subclass or the expected return type for method chaining.
9
+ */
2
10
  export declare abstract class SwitchCase<T, P extends IChainContainer, W> {
3
11
  protected pipe: P;
4
12
  protected counter: number;
13
+ /**
14
+ * Creates an instance of the class and initializes the pipe and counter.
15
+ *
16
+ * @param {P} pipe - The pipe object used for initialization.
17
+ * @return {void}
18
+ */
5
19
  constructor(pipe: P);
20
+ /**
21
+ * Adds a conditional case to the processing chain. The case determines
22
+ * whether further processing should continue based on the provided condition.
23
+ *
24
+ * @param {ICallback<any>} condition - A callback function that takes a payload
25
+ * and evaluates a condition. If the condition is met, further processing may be stopped.
26
+ * @return {W} Returns the current instance for method chaining.
27
+ */
6
28
  case(condition: ICallback<any>): W;
29
+ /**
30
+ * Adds an array of conditions to the current instance by iterating through the provided array
31
+ * and adding each individual condition using the `case` method of the instance.
32
+ *
33
+ * @param {ICallback<any>[]} conditions - An array of callback functions representing conditions to be added.
34
+ * @return {W} The current instance after all conditions have been added.
35
+ */
7
36
  pushCases(conditions: ICallback<any>[]): W;
8
37
  }
@@ -1,13 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SwitchCase = void 0;
4
+ /**
5
+ * Abstract class representing a Switch-Case control structure for handling
6
+ * conditional chains of operations.
7
+ *
8
+ * @template T - The type of the input payload expected by the conditions.
9
+ * @template P - The type extending IChainContainer, representing the container for the chain of operations.
10
+ * @template W - The type of the subclass or the expected return type for method chaining.
11
+ */
4
12
  class SwitchCase {
5
13
  pipe;
6
14
  counter;
15
+ /**
16
+ * Creates an instance of the class and initializes the pipe and counter.
17
+ *
18
+ * @param {P} pipe - The pipe object used for initialization.
19
+ * @return {void}
20
+ */
7
21
  constructor(pipe) {
8
22
  this.pipe = pipe;
9
23
  this.counter = pipe.chain.length ? pipe.chain.length : 0;
10
24
  }
25
+ /**
26
+ * Adds a conditional case to the processing chain. The case determines
27
+ * whether further processing should continue based on the provided condition.
28
+ *
29
+ * @param {ICallback<any>} condition - A callback function that takes a payload
30
+ * and evaluates a condition. If the condition is met, further processing may be stopped.
31
+ * @return {W} Returns the current instance for method chaining.
32
+ */
11
33
  case(condition) {
12
34
  this.counter++;
13
35
  const id = this.counter;
@@ -21,6 +43,13 @@ class SwitchCase {
21
43
  });
22
44
  return this;
23
45
  }
46
+ /**
47
+ * Adds an array of conditions to the current instance by iterating through the provided array
48
+ * and adding each individual condition using the `case` method of the instance.
49
+ *
50
+ * @param {ICallback<any>[]} conditions - An array of callback functions representing conditions to be added.
51
+ * @return {W} The current instance after all conditions have been added.
52
+ */
24
53
  pushCases(conditions) {
25
54
  if (!Array.isArray(conditions))
26
55
  return this;
@@ -1,11 +1,56 @@
1
1
  import { ICollector, ISubscriptionLike } from "./Types";
2
+ /**
3
+ * The Collector class is responsible for managing a collection of resources or subscription-like objects
4
+ * that need to be cleaned up or unsubscribed from, ensuring proper resource management.
5
+ * Implements the ICollector interface.
6
+ *
7
+ * The typical lifecycle of a Collector involves collecting subscription-like items, optionally
8
+ * unsubscribing from specific ones, unsubscribing from all resources, and destroying the collector
9
+ * when it's no longer needed.
10
+ */
2
11
  export declare class Collector implements ICollector {
3
12
  protected arr: ISubscriptionLike[];
4
13
  private killed;
14
+ /**
15
+ * Adds one or more subscription-like objects to the internal collection.
16
+ * Ensures the subscriptions are saved for future management if the object
17
+ * is not in a "killed" state.
18
+ *
19
+ * @param {ISubscriptionLike[]} subscriptionLikeList - The subscription-like objects to be collected.
20
+ * @return {void} This method does not return a value.
21
+ */
5
22
  collect(...subscriptionLikeList: ISubscriptionLike[]): void;
23
+ /**
24
+ * Unsubscribes a given subscription and removes it from the internal array.
25
+ *
26
+ * @param {ISubscriptionLike | undefined} subscriptionLike - The subscription to unsubscribe and remove. If undefined, no action is taken.
27
+ * @return {void} This method does not return a value.
28
+ */
6
29
  unsubscribe(subscriptionLike: ISubscriptionLike | undefined): void;
30
+ /**
31
+ * Unsubscribes from all the currently active subscriptions managed by this instance.
32
+ * If the instance is marked as killed, the method will exit without performing any action.
33
+ *
34
+ * @return {void | null} Returns `null` if the instance is killed, otherwise does not return a value.
35
+ */
7
36
  unsubscribeAll(): void | null;
37
+ /**
38
+ * Determines the size of the array managed by the instance.
39
+ * If the instance is marked as killed, the size is returned as 0.
40
+ *
41
+ * @return {number} The number of elements in the array, or 0 if the instance is killed.
42
+ */
8
43
  size(): number;
44
+ /**
45
+ * Cleans up resources by unsubscribing from all subscriptions, clearing the array, and marking the instance as destroyed.
46
+ *
47
+ * @return {void} Does not return any value.
48
+ */
9
49
  destroy(): void;
50
+ /**
51
+ * Checks if the object is destroyed.
52
+ *
53
+ * @return {boolean} Returns true if the object is destroyed, otherwise false.
54
+ */
10
55
  get isDestroyed(): boolean;
11
56
  }
@@ -2,36 +2,83 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Collector = void 0;
4
4
  const FunctionLibs_1 = require("./FunctionLibs");
5
+ /**
6
+ * The Collector class is responsible for managing a collection of resources or subscription-like objects
7
+ * that need to be cleaned up or unsubscribed from, ensuring proper resource management.
8
+ * Implements the ICollector interface.
9
+ *
10
+ * The typical lifecycle of a Collector involves collecting subscription-like items, optionally
11
+ * unsubscribing from specific ones, unsubscribing from all resources, and destroying the collector
12
+ * when it's no longer needed.
13
+ */
5
14
  class Collector {
6
15
  arr = [];
7
16
  killed = false;
17
+ /**
18
+ * Adds one or more subscription-like objects to the internal collection.
19
+ * Ensures the subscriptions are saved for future management if the object
20
+ * is not in a "killed" state.
21
+ *
22
+ * @param {ISubscriptionLike[]} subscriptionLikeList - The subscription-like objects to be collected.
23
+ * @return {void} This method does not return a value.
24
+ */
8
25
  collect(...subscriptionLikeList) {
9
26
  if (!this.killed)
10
27
  this.arr.push(...subscriptionLikeList);
11
28
  }
29
+ /**
30
+ * Unsubscribes a given subscription and removes it from the internal array.
31
+ *
32
+ * @param {ISubscriptionLike | undefined} subscriptionLike - The subscription to unsubscribe and remove. If undefined, no action is taken.
33
+ * @return {void} This method does not return a value.
34
+ */
12
35
  unsubscribe(subscriptionLike) {
13
36
  if (this.killed)
14
37
  return;
15
38
  subscriptionLike?.unsubscribe();
16
39
  (0, FunctionLibs_1.quickDeleteFromArray)(this.arr, subscriptionLike);
17
40
  }
41
+ /**
42
+ * Unsubscribes from all the currently active subscriptions managed by this instance.
43
+ * If the instance is marked as killed, the method will exit without performing any action.
44
+ *
45
+ * @return {void | null} Returns `null` if the instance is killed, otherwise does not return a value.
46
+ */
18
47
  unsubscribeAll() {
19
48
  if (this.killed)
20
49
  return;
21
- while (this.arr.length > 0)
22
- this.unsubscribe(this.arr.pop());
50
+ const arr = this.arr;
51
+ for (let i = 0; i < arr.length; i++)
52
+ arr[i].unsubscribe();
53
+ arr.length = 0;
23
54
  }
55
+ /**
56
+ * Determines the size of the array managed by the instance.
57
+ * If the instance is marked as killed, the size is returned as 0.
58
+ *
59
+ * @return {number} The number of elements in the array, or 0 if the instance is killed.
60
+ */
24
61
  size() {
25
62
  if (this.killed)
26
63
  return 0;
27
64
  return this.arr.length;
28
65
  }
66
+ /**
67
+ * Cleans up resources by unsubscribing from all subscriptions, clearing the array, and marking the instance as destroyed.
68
+ *
69
+ * @return {void} Does not return any value.
70
+ */
29
71
  destroy() {
30
72
  this.unsubscribeAll();
31
73
  this.arr.length = 0;
32
74
  this.arr = 0;
33
75
  this.killed = true;
34
76
  }
77
+ /**
78
+ * Checks if the object is destroyed.
79
+ *
80
+ * @return {boolean} Returns true if the object is destroyed, otherwise false.
81
+ */
35
82
  get isDestroyed() {
36
83
  return this.killed;
37
84
  }
@@ -1,17 +1,70 @@
1
1
  import { ICallback, IErrorCallback, IFilter, IFilterCase, IFilterChainCallback, IFilterPayload, IFilterResponse, IFilterSetup, IFilterSwitch } from "./Types";
2
2
  import { SwitchCase } from "./AbstractSwitchCase";
3
+ /**
4
+ * FilterCollection is a generic class implementing the IFilter and IFilterSwitch interfaces.
5
+ * It is designed to handle a series of filtering operations on a given payload, structured as a chain of filter methods.
6
+ * The class allows addition of filters, chaining of multiple filters, and provides mechanisms for handling payload processing flow.
7
+ *
8
+ * @template T The type of data that the filters will operate upon.
9
+ */
3
10
  export declare class FilterCollection<T> implements IFilter<T>, IFilterSwitch<T> {
4
11
  chain: IFilterChainCallback[];
5
12
  flow: IFilterPayload;
6
13
  response: IFilterResponse;
7
14
  private errHandler;
15
+ /**
16
+ * Determines whether the chain is empty.
17
+ * @return {boolean} Returns true if the chain contains no elements, otherwise false.
18
+ */
8
19
  get isEmpty(): boolean;
20
+ /**
21
+ * Adds a callback to the filter chain and returns the current instance.
22
+ *
23
+ * @param {IFilterChainCallback} callback - The callback function to be added to the filter chain.
24
+ * @return {IFilterSetup<T>} The current instance of IFilterSetup.
25
+ */
9
26
  private push;
27
+ /**
28
+ * Filters the data based on the given condition.
29
+ *
30
+ * @param {ICallback<any>} condition - A callback function that determines whether a data item should be included.
31
+ * Should return a truthy value to include the item.
32
+ * @return {IFilterSetup<T>} - The updated filter setup after applying the condition.
33
+ */
10
34
  filter(condition: ICallback<any>): IFilterSetup<T>;
35
+ /**
36
+ * Adds an array of filter conditions to the current filter setup.
37
+ *
38
+ * @param {ICallback<any>[]} conditions - An array of callback functions representing filter conditions.
39
+ * @return {IFilterSetup<T>} The updated filter setup instance.
40
+ */
11
41
  pushFilters(conditions: ICallback<any>[]): IFilterSetup<T>;
42
+ /**
43
+ * Creates and returns a new instance of the `FilterSwitchCase` class to handle switch case logic with the current context.
44
+ *
45
+ * @return {FilterSwitchCase<T>} A new instance of `FilterSwitchCase` initialized with the current context.
46
+ */
12
47
  switch(): FilterSwitchCase<T>;
48
+ /**
49
+ * Processes a chain of functions with the given input value and manages the execution flow through the chain.
50
+ *
51
+ * @param {T} value - The input value to be processed through the chain.
52
+ * @return {IFilterResponse} The final response containing the processing status and payload.
53
+ */
13
54
  processChain(value: T): IFilterResponse;
55
+ /**
56
+ * Assigns an error handler function to manage errors within the application.
57
+ *
58
+ * @param {IErrorCallback} errorHandler - A callback function that will handle error events.
59
+ * @return {void}
60
+ */
14
61
  addErrorHandler(errorHandler: IErrorCallback): void;
15
62
  }
63
+ /**
64
+ * The FilterSwitchCase class extends the SwitchCase class and represents a specific type of switch case
65
+ * logic applied to a collection of filters. It is used for branching logic based on filter cases.
66
+ *
67
+ * @template T - The type of the elements being processed by the filters.
68
+ */
16
69
  export declare class FilterSwitchCase<T> extends SwitchCase<T, FilterCollection<T>, IFilterCase<T>> {
17
70
  }
@@ -2,21 +2,51 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FilterSwitchCase = exports.FilterCollection = void 0;
4
4
  const AbstractSwitchCase_1 = require("./AbstractSwitchCase");
5
+ /**
6
+ * FilterCollection is a generic class implementing the IFilter and IFilterSwitch interfaces.
7
+ * It is designed to handle a series of filtering operations on a given payload, structured as a chain of filter methods.
8
+ * The class allows addition of filters, chaining of multiple filters, and provides mechanisms for handling payload processing flow.
9
+ *
10
+ * @template T The type of data that the filters will operate upon.
11
+ */
5
12
  class FilterCollection {
6
13
  chain = [];
7
14
  flow = { isBreak: false, isAvailable: false, payload: null };
8
15
  response = { isOK: false, payload: undefined };
9
16
  errHandler;
17
+ /**
18
+ * Determines whether the chain is empty.
19
+ * @return {boolean} Returns true if the chain contains no elements, otherwise false.
20
+ */
10
21
  get isEmpty() {
11
22
  return !this.chain.length;
12
23
  }
24
+ /**
25
+ * Adds a callback to the filter chain and returns the current instance.
26
+ *
27
+ * @param {IFilterChainCallback} callback - The callback function to be added to the filter chain.
28
+ * @return {IFilterSetup<T>} The current instance of IFilterSetup.
29
+ */
13
30
  push(callback) {
14
31
  this.chain.push(callback);
15
32
  return this;
16
33
  }
34
+ /**
35
+ * Filters the data based on the given condition.
36
+ *
37
+ * @param {ICallback<any>} condition - A callback function that determines whether a data item should be included.
38
+ * Should return a truthy value to include the item.
39
+ * @return {IFilterSetup<T>} - The updated filter setup after applying the condition.
40
+ */
17
41
  filter(condition) {
18
42
  return this.push((data) => condition(data.payload) && (data.isAvailable = true));
19
43
  }
44
+ /**
45
+ * Adds an array of filter conditions to the current filter setup.
46
+ *
47
+ * @param {ICallback<any>[]} conditions - An array of callback functions representing filter conditions.
48
+ * @return {IFilterSetup<T>} The updated filter setup instance.
49
+ */
20
50
  pushFilters(conditions) {
21
51
  if (!Array.isArray(conditions))
22
52
  return this;
@@ -24,9 +54,20 @@ class FilterCollection {
24
54
  this.filter(conditions[i]);
25
55
  return this;
26
56
  }
57
+ /**
58
+ * Creates and returns a new instance of the `FilterSwitchCase` class to handle switch case logic with the current context.
59
+ *
60
+ * @return {FilterSwitchCase<T>} A new instance of `FilterSwitchCase` initialized with the current context.
61
+ */
27
62
  switch() {
28
63
  return new FilterSwitchCase(this);
29
64
  }
65
+ /**
66
+ * Processes a chain of functions with the given input value and manages the execution flow through the chain.
67
+ *
68
+ * @param {T} value - The input value to be processed through the chain.
69
+ * @return {IFilterResponse} The final response containing the processing status and payload.
70
+ */
30
71
  processChain(value) {
31
72
  const chain = this.chain;
32
73
  const data = this.flow;
@@ -36,7 +77,8 @@ class FilterCollection {
36
77
  data.payload = value;
37
78
  data.isBreak = false;
38
79
  try {
39
- for (let i = 0; i < chain.length; i++) {
80
+ const len = chain.length;
81
+ for (let i = 0; i < len; i++) {
40
82
  data.isAvailable = false;
41
83
  chain[i](data);
42
84
  if (!data.isAvailable)
@@ -58,11 +100,23 @@ class FilterCollection {
58
100
  response.payload = data.payload;
59
101
  return response;
60
102
  }
103
+ /**
104
+ * Assigns an error handler function to manage errors within the application.
105
+ *
106
+ * @param {IErrorCallback} errorHandler - A callback function that will handle error events.
107
+ * @return {void}
108
+ */
61
109
  addErrorHandler(errorHandler) {
62
110
  this.errHandler = errorHandler;
63
111
  }
64
112
  }
65
113
  exports.FilterCollection = FilterCollection;
114
+ /**
115
+ * The FilterSwitchCase class extends the SwitchCase class and represents a specific type of switch case
116
+ * logic applied to a collection of filters. It is used for branching logic based on filter cases.
117
+ *
118
+ * @template T - The type of the elements being processed by the filters.
119
+ */
66
120
  class FilterSwitchCase extends AbstractSwitchCase_1.SwitchCase {
67
121
  }
68
122
  exports.FilterSwitchCase = FilterSwitchCase;
@@ -1,6 +1,48 @@
1
1
  import { IListener, ISubscribeGroup, ISubscribeObject } from "./Types";
2
+ /**
3
+ * Compares two ISubscribeObject items based on their `order` property
4
+ * and sorts them in ascending order.
5
+ *
6
+ * @param {ISubscribeObject<any>} a - The first object to compare.
7
+ * @param {ISubscribeObject<any>} b - The second object to compare.
8
+ * @return {number} - Returns 1 if the `order` property of `a` is greater than `b`,
9
+ * -1 if the `order` property of `a` is less than `b`,
10
+ * or 0 if they are equal.
11
+ */
2
12
  export declare function sortAscending(a: ISubscribeObject<any>, b: ISubscribeObject<any>): number;
13
+ /**
14
+ * Compares two objects based on their `order` property for descending sorting.
15
+ *
16
+ * @param {ISubscribeObject<any>} a - The first object to compare, expected to have an `order` property.
17
+ * @param {ISubscribeObject<any>} b - The second object to compare, expected to have an `order` property.
18
+ * @return {number} - Returns -1 if `a.order` is greater than `b.order`, 1 if `a.order` is less than `b.order`, and 0 if they are equal.
19
+ */
3
20
  export declare function sortDescending(a: ISubscribeObject<any>, b: ISubscribeObject<any>): number;
21
+ /**
22
+ * Removes the specified component from the provided array if it exists.
23
+ *
24
+ * @param {T[]} arr - The array from which the component will be removed.
25
+ * @param {T} component - The component to be removed from the array.
26
+ * @return {boolean} Returns true if the component was successfully removed, false otherwise.
27
+ */
4
28
  export declare function deleteFromArray<T>(arr: T[], component: T): boolean;
29
+ /**
30
+ * Removes a specified element from an array by replacing it with the last element
31
+ * and reducing the array's length. This method avoids maintaining order but performs
32
+ * the deletion operation efficiently.
33
+ *
34
+ * @param {T[]} arr - The array from which the element will be removed.
35
+ * @param {T} component - The element to be removed from the array.
36
+ * @return {boolean} - Returns true if the element was found and removed;
37
+ * otherwise, returns false.
38
+ */
5
39
  export declare function quickDeleteFromArray<T>(arr: T[], component: T): boolean;
6
- export declare function getListener<T>(listener: ISubscribeGroup<T>): IListener<T>;
40
+ /**
41
+ * Returns a listener function based on the provided listener group.
42
+ *
43
+ * @param {ISubscribeGroup<T>} listenerGroup - The group of listener(s). It can be a single listener
44
+ * or an array of listeners that are invoked when the returned listener is called.
45
+ * @return {IListener<T>} A single listener function that wraps the provided listener or group of listeners
46
+ * and invokes them with the provided data.
47
+ */
48
+ export declare function getListener<T>(listenerGroup: ISubscribeGroup<T>): IListener<T>;