@cripty2001/utils 0.0.145 → 0.0.146
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/react-whispr.d.ts +1 -3
- package/dist/react-whispr.js +2 -4
- package/package.json +1 -1
package/dist/react-whispr.d.ts
CHANGED
|
@@ -110,11 +110,9 @@ export declare function useAsync<I, O>(f: (input: I, setProgress: (p: number) =>
|
|
|
110
110
|
export declare function useAsyncEffect<I>(f: (input: I, setProgress: (p: number) => void, signal: AbortSignal) => Promise<void>, data: I, debounce?: number): void;
|
|
111
111
|
/**
|
|
112
112
|
* Format a timestamp into a relative time string (e.g. "5 minutes ago", "in 2 hours"), using the browser locale.
|
|
113
|
-
* The refreshed time is reactive.
|
|
114
|
-
* @param refresh The refresh interval, in milliseconds. Default to 1000ms.
|
|
115
113
|
* @returns A callback (reactive, will change on refresh) that formats a given timestamp into a relative time string.
|
|
116
114
|
*/
|
|
117
|
-
export declare function useRelTime(
|
|
115
|
+
export declare function useRelTime(): (ts: Date | number) => string;
|
|
118
116
|
/**
|
|
119
117
|
* React shorthand for the Searcher
|
|
120
118
|
* @param data The data to search on
|
package/dist/react-whispr.js
CHANGED
|
@@ -214,12 +214,10 @@ function useAsyncEffect(f, data, debounce = 200) {
|
|
|
214
214
|
}
|
|
215
215
|
/**
|
|
216
216
|
* Format a timestamp into a relative time string (e.g. "5 minutes ago", "in 2 hours"), using the browser locale.
|
|
217
|
-
* The refreshed time is reactive.
|
|
218
|
-
* @param refresh The refresh interval, in milliseconds. Default to 1000ms.
|
|
219
217
|
* @returns A callback (reactive, will change on refresh) that formats a given timestamp into a relative time string.
|
|
220
218
|
*/
|
|
221
|
-
function useRelTime(
|
|
222
|
-
const currTs = useCurrentTimestamp(
|
|
219
|
+
function useRelTime() {
|
|
220
|
+
const currTs = useCurrentTimestamp(1000);
|
|
223
221
|
const rtf = (0, react_1.useRef)(new Intl.RelativeTimeFormat(navigator.language, { numeric: "auto" })).current;
|
|
224
222
|
const getFormat = (_diff) => {
|
|
225
223
|
const diff = Math.abs(_diff);
|
package/package.json
CHANGED