@frontegg/react-hooks 6.2.4 → 6.4.0
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/FronteggProvider.js +1 -3
- package/FronteggStoreContext.d.ts +11 -6
- package/FronteggStoreContext.js +3 -2
- package/audits/auditLogs.d.ts +3 -3
- package/audits/auditLogs.js +6 -1
- package/audits/auditsMetadata.d.ts +3 -3
- package/audits/auditsMetadata.js +7 -2
- package/audits/hooks.d.ts +7 -2
- package/audits/hooks.js +8 -8
- package/auth/acceptInvitation.d.ts +3 -3
- package/auth/acceptInvitation.js +6 -1
- package/auth/activateAccount.d.ts +3 -3
- package/auth/activateAccount.js +6 -1
- package/auth/apiTokens.d.ts +3 -3
- package/auth/apiTokens.js +6 -1
- package/auth/forgotPassword.d.ts +3 -3
- package/auth/forgotPassword.js +6 -1
- package/auth/hooks.d.ts +4 -4
- package/auth/hooks.js +2 -2
- package/auth/login.d.ts +3 -3
- package/auth/login.js +6 -1
- package/auth/mfa.d.ts +4 -2
- package/auth/mfa.js +6 -1
- package/auth/profile.d.ts +3 -3
- package/auth/profile.js +6 -1
- package/auth/resetPhoneNumber.d.ts +3 -3
- package/auth/resetPhoneNumber.js +6 -1
- package/auth/roles.d.ts +3 -3
- package/auth/roles.js +6 -1
- package/auth/securityPolicy.d.ts +3 -3
- package/auth/securityPolicy.js +6 -1
- package/auth/sessions.d.ts +3 -3
- package/auth/sessions.js +6 -1
- package/auth/sessionsPolicy.d.ts +4 -5
- package/auth/sessionsPolicy.js +6 -1
- package/auth/signup.d.ts +3 -3
- package/auth/signup.js +6 -1
- package/auth/socialLogin.d.ts +3 -3
- package/auth/socialLogin.js +6 -1
- package/auth/sso.d.ts +4 -2
- package/auth/sso.js +6 -1
- package/auth/team.d.ts +3 -3
- package/auth/team.js +6 -1
- package/auth/tenants.d.ts +3 -3
- package/auth/tenants.js +6 -1
- package/connectivity/hooks.d.ts +3 -2
- package/connectivity/hooks.js +5 -6
- package/index.js +1 -1
- package/node/FronteggProvider.js +1 -5
- package/node/FronteggStoreContext.js +4 -8
- package/node/audits/auditLogs.js +6 -3
- package/node/audits/auditsMetadata.js +8 -5
- package/node/audits/hooks.js +10 -10
- package/node/auth/acceptInvitation.js +6 -3
- package/node/auth/activateAccount.js +6 -3
- package/node/auth/apiTokens.js +6 -3
- package/node/auth/forgotPassword.js +6 -3
- package/node/auth/hooks.js +5 -5
- package/node/auth/login.js +6 -3
- package/node/auth/mfa.js +6 -3
- package/node/auth/profile.js +6 -3
- package/node/auth/resetPhoneNumber.js +6 -3
- package/node/auth/roles.js +6 -3
- package/node/auth/securityPolicy.js +6 -3
- package/node/auth/sessions.js +6 -3
- package/node/auth/sessionsPolicy.js +6 -3
- package/node/auth/signup.js +6 -3
- package/node/auth/socialLogin.js +6 -3
- package/node/auth/sso.js +6 -3
- package/node/auth/team.js +6 -3
- package/node/auth/tenants.js +6 -3
- package/node/connectivity/hooks.js +6 -9
- package/node/index.js +1 -1
- package/node/vendor/hooks.js +6 -9
- package/package.json +4 -4
- package/vendor/hooks.d.ts +3 -2
- package/vendor/hooks.js +5 -6
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/react-hooks",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"main": "./node/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Frontegg LTD",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@babel/runtime": "^7.
|
|
9
|
-
"@frontegg/redux-store": "6.
|
|
10
|
-
"@frontegg/types": "6.
|
|
8
|
+
"@babel/runtime": "^7.18.6",
|
|
9
|
+
"@frontegg/redux-store": "6.4.0",
|
|
10
|
+
"@frontegg/types": "6.4.0",
|
|
11
11
|
"@types/react": "*",
|
|
12
12
|
"react-redux": "^7.x"
|
|
13
13
|
},
|
package/vendor/hooks.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VendorActions, VendorState } from '@frontegg/redux-store';
|
|
2
|
-
export declare type VendorStateMapper<S
|
|
2
|
+
export declare type VendorStateMapper<S> = (state: VendorState) => S;
|
|
3
3
|
export declare type StateHookFunction<T> = (() => T) & (<S extends object>(mapper: (state: T) => S) => S);
|
|
4
|
-
export declare
|
|
4
|
+
export declare function useVendorState(): VendorState;
|
|
5
|
+
export declare function useVendorState<S>(stateMapper: VendorStateMapper<S>): S;
|
|
5
6
|
export declare const useVendorActions: () => VendorActions;
|
package/vendor/hooks.js
CHANGED
|
@@ -2,13 +2,12 @@ import { useMemo } from 'react';
|
|
|
2
2
|
import { bindActionCreators, vendorActions, vendorStoreName } from '@frontegg/redux-store';
|
|
3
3
|
import { shallowEqual } from 'react-redux';
|
|
4
4
|
import { useSelector, useDispatch } from '../FronteggStoreContext';
|
|
5
|
-
export const useVendorState = stateMapper => {
|
|
6
|
-
return useSelector(state => {
|
|
7
|
-
var _stateMapper;
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
const defaultMapper = state => state;
|
|
7
|
+
|
|
8
|
+
export function useVendorState(stateMapper = defaultMapper) {
|
|
9
|
+
return useSelector(state => stateMapper(state[vendorStoreName]), shallowEqual);
|
|
10
|
+
}
|
|
12
11
|
export const useVendorActions = () => {
|
|
13
12
|
const dispatch = useDispatch();
|
|
14
13
|
return useMemo(() => bindActionCreators(vendorActions, dispatch), [vendorActions]);
|