@asaidimu/utils-store 10.2.3 → 10.2.4
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/index.d.mts +2 -6
- package/index.d.ts +2 -6
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -11,18 +11,14 @@ interface EventBus<TEventMap extends Record<string, any>> {
|
|
|
11
11
|
* subscription
|
|
12
12
|
* @returns A function to unsubscribe from the event.
|
|
13
13
|
*/
|
|
14
|
-
subscribe<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap]
|
|
15
|
-
__event__: keyof TEventMap;
|
|
16
|
-
}) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
14
|
+
subscribe<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap], event: keyof TEventMap) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
17
15
|
/**
|
|
18
16
|
* Subscribes to an event and automatically unsubscribes after it fires once.
|
|
19
17
|
* @param eventName - The name of the event to subscribe to.
|
|
20
18
|
* @param callback - The function to call when the event is emitted.
|
|
21
19
|
* @returns A function to cancel the one-shot subscription before it fires.
|
|
22
20
|
*/
|
|
23
|
-
once<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap]
|
|
24
|
-
__event__: keyof TEventMap;
|
|
25
|
-
}) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
21
|
+
once<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap], event: keyof TEventMap) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
26
22
|
/**
|
|
27
23
|
* Emits an event with a payload to all subscribed listeners.
|
|
28
24
|
* @param event - An object containing the event name and payload.
|
package/index.d.ts
CHANGED
|
@@ -11,18 +11,14 @@ interface EventBus<TEventMap extends Record<string, any>> {
|
|
|
11
11
|
* subscription
|
|
12
12
|
* @returns A function to unsubscribe from the event.
|
|
13
13
|
*/
|
|
14
|
-
subscribe<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap]
|
|
15
|
-
__event__: keyof TEventMap;
|
|
16
|
-
}) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
14
|
+
subscribe<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap], event: keyof TEventMap) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
17
15
|
/**
|
|
18
16
|
* Subscribes to an event and automatically unsubscribes after it fires once.
|
|
19
17
|
* @param eventName - The name of the event to subscribe to.
|
|
20
18
|
* @param callback - The function to call when the event is emitted.
|
|
21
19
|
* @returns A function to cancel the one-shot subscription before it fires.
|
|
22
20
|
*/
|
|
23
|
-
once<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap]
|
|
24
|
-
__event__: keyof TEventMap;
|
|
25
|
-
}) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
21
|
+
once<TEventName extends keyof TEventMap | "*">(eventName: TEventName, callback: TEventName extends "*" ? (payload: TEventMap[keyof TEventMap], event: keyof TEventMap) => void : (payload: TEventMap[TEventName]) => void, options?: SubscribeOptions): () => void;
|
|
26
22
|
/**
|
|
27
23
|
* Emits an event with a payload to all subscribed listeners.
|
|
28
24
|
* @param event - An object containing the event name and payload.
|