@cripty2001/utils 0.0.23 → 0.0.25

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/index.d.ts CHANGED
@@ -27,3 +27,4 @@ export declare function parseQuery(query: string | Record<string, any> | URLSear
27
27
  extracted: URLSearchParams;
28
28
  left: URLSearchParams;
29
29
  };
30
+ export declare function randBetween(min: number, max: number): number;
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ exports.arrayStep = arrayStep;
11
11
  exports.copyToClipboard = copyToClipboard;
12
12
  exports.stableLog = stableLog;
13
13
  exports.parseQuery = parseQuery;
14
+ exports.randBetween = randBetween;
14
15
  const lodash_1 = require("lodash");
15
16
  function getRandom(_alphabeth, length) {
16
17
  const alphabeth = _alphabeth.split("");
@@ -118,3 +119,6 @@ function parseQuery(query, fields) {
118
119
  left: data
119
120
  };
120
121
  }
122
+ function randBetween(min, max) {
123
+ return Math.floor(Math.random() * (max - min + 1)) + min;
124
+ }
@@ -87,10 +87,10 @@ function useDebounced(value) {
87
87
  */
88
88
  function useAsync(f, data, debouce = 200) {
89
89
  // Initing reactive input
90
- const [input, setInput] = whispr_1.Whispr.create(data);
90
+ const [input, setInput] = (0, react_1.useRef)(whispr_1.Whispr.create(data)).current;
91
91
  (0, react_1.useEffect)(() => {
92
92
  setInput(data); // Debouncing already handled by dispatcher
93
- }, [data, input, setInput]);
93
+ }, [data, setInput]);
94
94
  // Initing dispatcher
95
95
  const dispatcher = (0, react_1.useRef)(new Dispatcher_1.Dispatcher(input, f, debouce)).current;
96
96
  // Returning dispatcher
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cripty2001/utils",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
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": {