@cripty2001/utils 0.0.142 → 0.0.143

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.
@@ -80,7 +80,7 @@ export declare function useRelTime(refresh?: number): (ts: Date | number) => str
80
80
  */
81
81
  export declare function useSearcher<T>(data: SearcherData<T>[], q: string): SearcherData<T>[];
82
82
  /**
83
- * A react ref hook with safe laxy initialization, ready for safe effects.
83
+ * A react ref hook with safe lazy initialization, ready for safe side effects.
84
84
  * @remarks The initialization function will only be called once, and the result will be stored in the ref.
85
85
  * @param value The value to initialize the ref with. If a function is provided, it will be called to initialize the ref.
86
86
  * @returns
@@ -232,17 +232,15 @@ function useSearcher(data, q) {
232
232
  return useWhisprValue(searcher);
233
233
  }
234
234
  /**
235
- * A react ref hook with safe laxy initialization, ready for safe effects.
235
+ * A react ref hook with safe lazy initialization, ready for safe side effects.
236
236
  * @remarks The initialization function will only be called once, and the result will be stored in the ref.
237
237
  * @param value The value to initialize the ref with. If a function is provided, it will be called to initialize the ref.
238
238
  * @returns
239
239
  */
240
240
  function useSafeRef(value) {
241
241
  const ref = (0, react_1.useRef)(null);
242
- (0, react_1.useEffect)(() => {
243
- if (ref.current !== null)
244
- return;
242
+ if (ref.current === null) {
245
243
  ref.current = value();
246
- }, []);
244
+ }
247
245
  return ref.current;
248
246
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cripty2001/utils",
3
- "version": "0.0.142",
3
+ "version": "0.0.143",
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": {