@frontegg/react-hooks
Advanced tools
@@ -25,1 +25,10 @@ import { RestrictionsActions, RestrictionsState } from '@frontegg/redux-store'; | ||
| }; | ||
| export declare const useCountryRestrictions: () => { | ||
| loading: boolean; | ||
| saving: boolean | undefined; | ||
| error: any; | ||
| data: { | ||
| config: import("dist/@frontegg/rest-api").CountryRestrictionConfig; | ||
| restrictions: import("dist/@frontegg/rest-api").CountryRestrictionRule[]; | ||
| } | undefined; | ||
| }; |
@@ -60,2 +60,24 @@ import { useEffect } from 'react'; | ||
| }; | ||
| }; | ||
| export const useCountryRestrictions = () => { | ||
| const { | ||
| loading, | ||
| data, | ||
| saving, | ||
| error | ||
| } = useRestrictionsState().countryRestrictions; | ||
| const { | ||
| loadCountryRestrictions | ||
| } = useRestrictionsActions(); | ||
| useEffect(() => { | ||
| if (!data && !loading) { | ||
| loadCountryRestrictions(); | ||
| } | ||
| }, [loadCountryRestrictions, data, loading]); | ||
| return { | ||
| loading, | ||
| saving, | ||
| error, | ||
| data | ||
| }; | ||
| }; |
+1
-1
@@ -1,2 +0,2 @@ | ||
| /** @license Frontegg v7.105.0-alpha.1 | ||
| /** @license Frontegg v7.105.0 | ||
| * | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -6,3 +6,3 @@ "use strict"; | ||
| }); | ||
| exports.useRestrictionsActions = exports.useIpRestrictions = exports.useEmailDomainRestrictions = void 0; | ||
| exports.useRestrictionsActions = exports.useIpRestrictions = exports.useEmailDomainRestrictions = exports.useCountryRestrictions = void 0; | ||
| exports.useRestrictionsState = useRestrictionsState; | ||
@@ -71,2 +71,25 @@ var _react = require("react"); | ||
| }; | ||
| exports.useEmailDomainRestrictions = useEmailDomainRestrictions; | ||
| exports.useEmailDomainRestrictions = useEmailDomainRestrictions; | ||
| const useCountryRestrictions = () => { | ||
| const { | ||
| loading, | ||
| data, | ||
| saving, | ||
| error | ||
| } = useRestrictionsState().countryRestrictions; | ||
| const { | ||
| loadCountryRestrictions | ||
| } = useRestrictionsActions(); | ||
| (0, _react.useEffect)(() => { | ||
| if (!data && !loading) { | ||
| loadCountryRestrictions(); | ||
| } | ||
| }, [loadCountryRestrictions, data, loading]); | ||
| return { | ||
| loading, | ||
| saving, | ||
| error, | ||
| data | ||
| }; | ||
| }; | ||
| exports.useCountryRestrictions = useCountryRestrictions; |
+1
-1
@@ -1,2 +0,2 @@ | ||
| /** @license Frontegg v7.105.0-alpha.1 | ||
| /** @license Frontegg v7.105.0 | ||
| * | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
+3
-3
| { | ||
| "name": "@frontegg/react-hooks", | ||
| "version": "7.105.0-alpha.1", | ||
| "version": "7.105.0", | ||
| "main": "./node/index.js", | ||
@@ -9,4 +9,4 @@ "license": "MIT", | ||
| "@babel/runtime": "^7.18.6", | ||
| "@frontegg/redux-store": "7.105.0-alpha.1", | ||
| "@frontegg/types": "7.105.0-alpha.1", | ||
| "@frontegg/redux-store": "7.105.0", | ||
| "@frontegg/types": "7.105.0", | ||
| "@types/react": "*", | ||
@@ -13,0 +13,0 @@ "@types/react-is": "^17.0.7", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
195538
0.62%5269
1.04%1
-50%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated