@cripty2001/utils 0.0.139 → 0.0.140

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.
@@ -148,7 +148,11 @@ function useSynced(def, value, setValue) {
148
148
  */
149
149
  function useAsync(f, data, debouce = 200) {
150
150
  // Initing reactive input
151
- const [input, setInput] = (0, react_1.useRef)(whispr_1.Whispr.create(data ?? (0, _1.getRandomId)())).current;
151
+ const whisprRef = (0, react_1.useRef)(null);
152
+ if (!whisprRef.current) {
153
+ whisprRef.current = whispr_1.Whispr.create(data ?? (0, _1.getRandomId)());
154
+ }
155
+ const [input, setInput] = whisprRef.current;
152
156
  if (data !== null) {
153
157
  (0, react_1.useEffect)(() => {
154
158
  setInput(data); // Debouncing already handled by dispatcher
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cripty2001/utils",
3
- "version": "0.0.139",
3
+ "version": "0.0.140",
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": {