dry-ux 1.47.0 → 1.48.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.
|
@@ -57,3 +57,7 @@ export declare class Deferred<T> {
|
|
|
57
57
|
}
|
|
58
58
|
export declare const tryParseJson: <T = any>(json: string, errorValue?: {}) => {};
|
|
59
59
|
export declare const useIsVisible: (ref: React.MutableRefObject<any>) => boolean;
|
|
60
|
+
export declare const usePubSub: <T>() => {
|
|
61
|
+
usePub: () => <TName extends keyof T, TPayload extends T[TName]>(event: TName, data?: TPayload) => void;
|
|
62
|
+
useSub: <TName_1 extends keyof T, TPayload_1 extends T[TName_1]>(event: TName_1, callback: (data: TPayload_1) => void) => () => void;
|
|
63
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useIsVisible = exports.tryParseJson = exports.Deferred = exports.getUrlParams = exports.insertUrlParams = exports.insertUrlParam = exports.toHashCode = exports.StorageUtils = exports.fnWithAuthCheck = exports.formatDollar = exports.useCountdown = exports.importStyleSheet = exports.importScript = exports.preventDefault = void 0;
|
|
3
|
+
exports.usePubSub = exports.useIsVisible = exports.tryParseJson = exports.Deferred = exports.getUrlParams = exports.insertUrlParams = exports.insertUrlParam = exports.toHashCode = exports.StorageUtils = exports.fnWithAuthCheck = exports.formatDollar = exports.useCountdown = exports.importStyleSheet = exports.importScript = exports.preventDefault = void 0;
|
|
4
4
|
const React = require("react");
|
|
5
5
|
/**
|
|
6
6
|
* Returns a function that will call the given handler and prevent the default event behavior.
|
|
@@ -216,3 +216,4 @@ const usePubSub = () => {
|
|
|
216
216
|
};
|
|
217
217
|
return { usePub, useSub };
|
|
218
218
|
};
|
|
219
|
+
exports.usePubSub = usePubSub;
|