@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.
@@ -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(refresh?: number): (ts: Date | number) => string;
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
@@ -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(refresh = 1000) {
222
- const currTs = useCurrentTimestamp(refresh);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cripty2001/utils",
3
- "version": "0.0.145",
3
+ "version": "0.0.146",
4
4
  "description": "Internal Set of utils. If you need them use them, otherwise go to the next package ;)",
5
5
  "homepage": "https://github.com/cripty2001/utils#readme",
6
6
  "bugs": {