@neovici/cosmoz-utils 6.8.1 → 6.9.0
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/promise.d.ts +1 -0
- package/dist/promise.js +5 -0
- package/package.json +1 -1
package/dist/promise.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ type Predicate<T extends Event> = (e: T) => boolean;
|
|
|
8
8
|
export declare const event$: <E extends Event, P extends Predicate<E> = Predicate<E>>(target: EventTarget, type: string, predicate?: P | undefined, timeout?: number) => Promise<E>;
|
|
9
9
|
export declare const limit$: <T extends unknown[], P>(fn: (...args: T) => PromiseLike<P>, limit: number) => (...args: T) => Promise<P>;
|
|
10
10
|
export declare const debounce$: <T extends unknown[], P>(fn: (...args: T) => P | PromiseLike<P>, ms?: number) => (...args: T) => Promise<P>;
|
|
11
|
+
export declare const log$: <T extends unknown[], P>(fn: (...args: T) => PromiseLike<P>) => (...args: T) => PromiseLike<P>;
|
|
11
12
|
export {};
|
package/dist/promise.js
CHANGED
|
@@ -65,3 +65,8 @@ export const debounce$ = (fn, ms) => {
|
|
|
65
65
|
pending.push({ resolve: res, reject: rej });
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
|
+
export const log$ = (fn) => (...args) => fn(...args).then((response) => {
|
|
69
|
+
// eslint-disable-next-line no-console
|
|
70
|
+
console.log(response);
|
|
71
|
+
return response;
|
|
72
|
+
});
|