quidproquo-web-react 0.0.254 → 0.0.255
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/lib/commonjs/api/hooks/index.d.ts +2 -2
- package/lib/commonjs/api/hooks/index.js +18 -18
- package/lib/commonjs/api/hooks/useAuthenticatedNetworkRequest.d.ts +2 -2
- package/lib/commonjs/api/hooks/useAuthenticatedNetworkRequest.js +14 -14
- package/lib/commonjs/api/hooks/useNetworkRequest.d.ts +2 -2
- package/lib/commonjs/api/hooks/useNetworkRequest.js +10 -10
- package/lib/commonjs/api/index.d.ts +1 -1
- package/lib/commonjs/api/index.js +17 -17
- package/lib/commonjs/auth/RefreshAuthTokensProvider.d.ts +7 -8
- package/lib/commonjs/auth/RefreshAuthTokensProvider.js +12 -12
- package/lib/commonjs/auth/authContext.d.ts +2 -3
- package/lib/commonjs/auth/authContext.js +8 -8
- package/lib/commonjs/auth/hooks/index.d.ts +3 -3
- package/lib/commonjs/auth/hooks/index.js +19 -19
- package/lib/commonjs/auth/hooks/useAuthAccessToken.d.ts +1 -1
- package/lib/commonjs/auth/hooks/useAuthAccessToken.js +12 -12
- package/lib/commonjs/auth/hooks/useIsLoggedIn.d.ts +1 -1
- package/lib/commonjs/auth/hooks/useIsLoggedIn.js +9 -9
- package/lib/commonjs/auth/hooks/useRefreshTokens.d.ts +2 -2
- package/lib/commonjs/auth/hooks/useRefreshTokens.js +35 -35
- package/lib/commonjs/auth/index.d.ts +4 -4
- package/lib/commonjs/auth/index.js +20 -20
- package/lib/commonjs/auth/types/AuthState.d.ts +8 -8
- package/lib/commonjs/auth/types/AuthState.js +2 -2
- package/lib/commonjs/auth/types/index.d.ts +1 -1
- package/lib/commonjs/auth/types/index.js +17 -17
- package/lib/commonjs/baseUrl/BaseUrlContext.d.ts +2 -3
- package/lib/commonjs/baseUrl/BaseUrlContext.js +9 -9
- package/lib/commonjs/baseUrl/BaseUrlProvider.d.ts +6 -7
- package/lib/commonjs/baseUrl/BaseUrlProvider.js +9 -9
- package/lib/commonjs/baseUrl/hooks/index.d.ts +1 -1
- package/lib/commonjs/baseUrl/hooks/index.js +17 -17
- package/lib/commonjs/baseUrl/hooks/useBaseUrlResolvers.d.ts +2 -2
- package/lib/commonjs/baseUrl/hooks/useBaseUrlResolvers.js +10 -10
- package/lib/commonjs/baseUrl/index.d.ts +3 -3
- package/lib/commonjs/baseUrl/index.js +19 -19
- package/lib/commonjs/baseUrl/types/BaseUrlResolver.d.ts +6 -6
- package/lib/commonjs/baseUrl/types/BaseUrlResolver.js +2 -2
- package/lib/commonjs/baseUrl/types/index.d.ts +1 -1
- package/lib/commonjs/baseUrl/types/index.js +17 -17
- package/lib/commonjs/hooks/asmj/QpqContextProvider.d.ts +10 -10
- package/lib/commonjs/hooks/asmj/QpqContextProvider.js +20 -20
- package/lib/commonjs/hooks/asmj/QpqMappedApi.d.ts +6 -6
- package/lib/commonjs/hooks/asmj/QpqMappedApi.js +2 -2
- package/lib/commonjs/hooks/asmj/QpqRuntimeEffectCatcher.d.ts +16 -16
- package/lib/commonjs/hooks/asmj/QpqRuntimeEffectCatcher.js +35 -35
- package/lib/commonjs/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.d.ts +3 -3
- package/lib/commonjs/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.js +23 -23
- package/lib/commonjs/hooks/asmj/actionProcessor/getStateReadActionProcessor.d.ts +2 -2
- package/lib/commonjs/hooks/asmj/actionProcessor/getStateReadActionProcessor.js +22 -22
- package/lib/commonjs/hooks/asmj/actionProcessor/index.d.ts +3 -3
- package/lib/commonjs/hooks/asmj/actionProcessor/index.js +18 -18
- package/lib/commonjs/hooks/asmj/createQpqRuntimeDefinition.d.ts +22 -22
- package/lib/commonjs/hooks/asmj/createQpqRuntimeDefinition.js +52 -53
- package/lib/commonjs/hooks/asmj/index.d.ts +6 -6
- package/lib/commonjs/hooks/asmj/index.js +22 -22
- package/lib/commonjs/hooks/asmj/useQpqRuntime.d.ts +4 -4
- package/lib/commonjs/hooks/asmj/useQpqRuntime.js +35 -36
- package/lib/commonjs/hooks/index.d.ts +8 -8
- package/lib/commonjs/hooks/index.js +24 -24
- package/lib/commonjs/hooks/useAsyncEffect.d.ts +2 -2
- package/lib/commonjs/hooks/useAsyncEffect.js +36 -36
- package/lib/commonjs/hooks/useFastCallback.d.ts +2 -2
- package/lib/commonjs/hooks/useFastCallback.js +19 -20
- package/lib/commonjs/hooks/useMetadata/index.d.ts +1 -1
- package/lib/commonjs/hooks/useMetadata/index.js +17 -17
- package/lib/commonjs/hooks/useMetadata/useMetadata.d.ts +5 -5
- package/lib/commonjs/hooks/useMetadata/useMetadata.js +14 -15
- package/lib/commonjs/hooks/useOnKeyDownEffect.d.ts +1 -1
- package/lib/commonjs/hooks/useOnKeyDownEffect.js +22 -23
- package/lib/commonjs/hooks/useQpq.d.ts +2 -2
- package/lib/commonjs/hooks/useQpq.js +45 -46
- package/lib/commonjs/hooks/useRunEvery.d.ts +1 -1
- package/lib/commonjs/hooks/useRunEvery.js +21 -22
- package/lib/commonjs/hooks/useThrottledMemo.d.ts +1 -1
- package/lib/commonjs/hooks/useThrottledMemo.js +31 -32
- package/lib/commonjs/index.d.ts +10 -10
- package/lib/commonjs/index.js +26 -26
- package/lib/commonjs/state/index.d.ts +1 -1
- package/lib/commonjs/state/index.js +17 -17
- package/lib/commonjs/state/useStateUpdater.d.ts +3 -4
- package/lib/commonjs/state/useStateUpdater.js +12 -12
- package/lib/commonjs/useFieldBinding/index.d.ts +1 -1
- package/lib/commonjs/useFieldBinding/index.js +17 -17
- package/lib/commonjs/useFieldBinding/useFieldBinding.d.ts +2 -2
- package/lib/commonjs/useFieldBinding/useFieldBinding.js +21 -21
- package/lib/commonjs/useSharedQueryParams/index.d.ts +2 -2
- package/lib/commonjs/useSharedQueryParams/index.js +18 -18
- package/lib/commonjs/useSharedQueryParams/logic/index.d.ts +4 -4
- package/lib/commonjs/useSharedQueryParams/logic/index.js +20 -20
- package/lib/commonjs/useSharedQueryParams/logic/runtime/askSetParam.d.ts +2 -2
- package/lib/commonjs/useSharedQueryParams/logic/runtime/askSetParam.js +9 -10
- package/lib/commonjs/useSharedQueryParams/logic/runtime/askSyncParams.d.ts +2 -2
- package/lib/commonjs/useSharedQueryParams/logic/runtime/askSyncParams.js +11 -12
- package/lib/commonjs/useSharedQueryParams/logic/runtime/index.d.ts +2 -2
- package/lib/commonjs/useSharedQueryParams/logic/runtime/index.js +18 -18
- package/lib/commonjs/useSharedQueryParams/logic/runtime/sharedQueryParamsLogic.d.ts +4 -4
- package/lib/commonjs/useSharedQueryParams/logic/runtime/sharedQueryParamsLogic.js +7 -7
- package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsActionCreator.d.ts +2 -2
- package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsActionCreator.js +11 -12
- package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsReducer.d.ts +3 -3
- package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsReducer.js +13 -13
- package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsTypes.d.ts +10 -10
- package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsTypes.js +7 -7
- package/lib/commonjs/useSharedQueryParams/sharedQueryParamsRuntime.d.ts +3 -3
- package/lib/commonjs/useSharedQueryParams/sharedQueryParamsRuntime.js +7 -7
- package/lib/commonjs/webSocketQueue/hooks/index.d.ts +2 -2
- package/lib/commonjs/webSocketQueue/hooks/index.js +18 -18
- package/lib/commonjs/webSocketQueue/hooks/useSubscribeToWebSocketQueueEvent.d.ts +3 -3
- package/lib/commonjs/webSocketQueue/hooks/useSubscribeToWebSocketQueueEvent.js +8 -8
- package/lib/commonjs/webSocketQueue/hooks/useWebsocketQueueSendEvent.d.ts +2 -2
- package/lib/commonjs/webSocketQueue/hooks/useWebsocketQueueSendEvent.js +9 -9
- package/lib/commonjs/webSocketQueue/index.d.ts +1 -1
- package/lib/commonjs/webSocketQueue/index.js +17 -17
- package/lib/commonjs/websocket/WebSocketAuthSync/WebSocketAuthSync.d.ts +6 -7
- package/lib/commonjs/websocket/WebSocketAuthSync/WebSocketAuthSync.js +14 -14
- package/lib/commonjs/websocket/WebSocketAuthSync/hooks/index.d.ts +2 -2
- package/lib/commonjs/websocket/WebSocketAuthSync/hooks/index.js +18 -18
- package/lib/commonjs/websocket/WebSocketAuthSync/hooks/useWebsocketAuthSync.d.ts +2 -2
- package/lib/commonjs/websocket/WebSocketAuthSync/hooks/useWebsocketAuthSync.js +37 -37
- package/lib/commonjs/websocket/WebSocketAuthSync/hooks/useWebsocketPingPong.d.ts +1 -1
- package/lib/commonjs/websocket/WebSocketAuthSync/hooks/useWebsocketPingPong.js +16 -16
- package/lib/commonjs/websocket/WebSocketAuthSync/index.d.ts +1 -1
- package/lib/commonjs/websocket/WebSocketAuthSync/index.js +17 -17
- package/lib/commonjs/websocket/WebsocketContext.d.ts +2 -3
- package/lib/commonjs/websocket/WebsocketContext.js +5 -5
- package/lib/commonjs/websocket/WebsocketProvider.d.ts +5 -6
- package/lib/commonjs/websocket/WebsocketProvider.js +11 -11
- package/lib/commonjs/websocket/hooks/index.d.ts +5 -5
- package/lib/commonjs/websocket/hooks/index.js +21 -21
- package/lib/commonjs/websocket/hooks/useSubscribeToWebSocketEvent.d.ts +3 -3
- package/lib/commonjs/websocket/hooks/useSubscribeToWebSocketEvent.js +17 -17
- package/lib/commonjs/websocket/hooks/useSubscribeToWebsocket.d.ts +2 -2
- package/lib/commonjs/websocket/hooks/useSubscribeToWebsocket.js +17 -17
- package/lib/commonjs/websocket/hooks/useWebsocketApi.d.ts +1 -1
- package/lib/commonjs/websocket/hooks/useWebsocketApi.js +10 -10
- package/lib/commonjs/websocket/hooks/useWebsocketManagement.d.ts +2 -2
- package/lib/commonjs/websocket/hooks/useWebsocketManagement.js +17 -17
- package/lib/commonjs/websocket/hooks/useWebsocketSendEvent.d.ts +2 -2
- package/lib/commonjs/websocket/hooks/useWebsocketSendEvent.js +15 -15
- package/lib/commonjs/websocket/index.d.ts +3 -3
- package/lib/commonjs/websocket/index.js +19 -19
- package/lib/esm/api/hooks/index.d.ts +2 -2
- package/lib/esm/api/hooks/index.js +2 -2
- package/lib/esm/api/hooks/useAuthenticatedNetworkRequest.d.ts +2 -2
- package/lib/esm/api/hooks/useAuthenticatedNetworkRequest.js +17 -17
- package/lib/esm/api/hooks/useNetworkRequest.d.ts +2 -2
- package/lib/esm/api/hooks/useNetworkRequest.js +6 -6
- package/lib/esm/api/index.d.ts +1 -1
- package/lib/esm/api/index.js +1 -1
- package/lib/esm/auth/RefreshAuthTokensProvider.d.ts +7 -8
- package/lib/esm/auth/RefreshAuthTokensProvider.js +9 -9
- package/lib/esm/auth/authContext.d.ts +2 -3
- package/lib/esm/auth/authContext.js +5 -5
- package/lib/esm/auth/hooks/index.d.ts +3 -3
- package/lib/esm/auth/hooks/index.js +3 -3
- package/lib/esm/auth/hooks/useAuthAccessToken.d.ts +1 -1
- package/lib/esm/auth/hooks/useAuthAccessToken.js +7 -7
- package/lib/esm/auth/hooks/useIsLoggedIn.d.ts +1 -1
- package/lib/esm/auth/hooks/useIsLoggedIn.js +5 -5
- package/lib/esm/auth/hooks/useRefreshTokens.d.ts +2 -2
- package/lib/esm/auth/hooks/useRefreshTokens.js +31 -31
- package/lib/esm/auth/index.d.ts +4 -4
- package/lib/esm/auth/index.js +4 -4
- package/lib/esm/auth/types/AuthState.d.ts +8 -8
- package/lib/esm/auth/types/AuthState.js +1 -1
- package/lib/esm/auth/types/index.d.ts +1 -1
- package/lib/esm/auth/types/index.js +1 -1
- package/lib/esm/baseUrl/BaseUrlContext.d.ts +2 -3
- package/lib/esm/baseUrl/BaseUrlContext.js +6 -6
- package/lib/esm/baseUrl/BaseUrlProvider.d.ts +6 -7
- package/lib/esm/baseUrl/BaseUrlProvider.js +5 -5
- package/lib/esm/baseUrl/hooks/index.d.ts +1 -1
- package/lib/esm/baseUrl/hooks/index.js +1 -1
- package/lib/esm/baseUrl/hooks/useBaseUrlResolvers.d.ts +2 -2
- package/lib/esm/baseUrl/hooks/useBaseUrlResolvers.js +6 -6
- package/lib/esm/baseUrl/index.d.ts +3 -3
- package/lib/esm/baseUrl/index.js +3 -3
- package/lib/esm/baseUrl/types/BaseUrlResolver.d.ts +6 -6
- package/lib/esm/baseUrl/types/BaseUrlResolver.js +1 -1
- package/lib/esm/baseUrl/types/index.d.ts +1 -1
- package/lib/esm/baseUrl/types/index.js +1 -1
- package/lib/esm/hooks/asmj/QpqContextProvider.d.ts +10 -10
- package/lib/esm/hooks/asmj/QpqContextProvider.js +15 -15
- package/lib/esm/hooks/asmj/QpqMappedApi.d.ts +6 -6
- package/lib/esm/hooks/asmj/QpqMappedApi.js +1 -1
- package/lib/esm/hooks/asmj/QpqRuntimeEffectCatcher.d.ts +16 -16
- package/lib/esm/hooks/asmj/QpqRuntimeEffectCatcher.js +30 -30
- package/lib/esm/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.d.ts +3 -3
- package/lib/esm/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.js +8 -8
- package/lib/esm/hooks/asmj/actionProcessor/getStateReadActionProcessor.d.ts +2 -2
- package/lib/esm/hooks/asmj/actionProcessor/getStateReadActionProcessor.js +7 -7
- package/lib/esm/hooks/asmj/actionProcessor/index.d.ts +3 -3
- package/lib/esm/hooks/asmj/actionProcessor/index.js +6 -6
- package/lib/esm/hooks/asmj/createQpqRuntimeDefinition.d.ts +22 -22
- package/lib/esm/hooks/asmj/createQpqRuntimeDefinition.js +46 -46
- package/lib/esm/hooks/asmj/index.d.ts +6 -6
- package/lib/esm/hooks/asmj/index.js +6 -6
- package/lib/esm/hooks/asmj/useQpqRuntime.d.ts +4 -4
- package/lib/esm/hooks/asmj/useQpqRuntime.js +32 -32
- package/lib/esm/hooks/index.d.ts +8 -8
- package/lib/esm/hooks/index.js +8 -8
- package/lib/esm/hooks/useAsyncEffect.d.ts +2 -2
- package/lib/esm/hooks/useAsyncEffect.js +23 -23
- package/lib/esm/hooks/useFastCallback.d.ts +2 -2
- package/lib/esm/hooks/useFastCallback.js +16 -16
- package/lib/esm/hooks/useMetadata/index.d.ts +1 -1
- package/lib/esm/hooks/useMetadata/index.js +1 -1
- package/lib/esm/hooks/useMetadata/useMetadata.d.ts +5 -5
- package/lib/esm/hooks/useMetadata/useMetadata.js +11 -11
- package/lib/esm/hooks/useOnKeyDownEffect.d.ts +1 -1
- package/lib/esm/hooks/useOnKeyDownEffect.js +19 -19
- package/lib/esm/hooks/useQpq.d.ts +2 -2
- package/lib/esm/hooks/useQpq.js +34 -34
- package/lib/esm/hooks/useRunEvery.d.ts +1 -1
- package/lib/esm/hooks/useRunEvery.js +18 -18
- package/lib/esm/hooks/useThrottledMemo.d.ts +1 -1
- package/lib/esm/hooks/useThrottledMemo.js +28 -28
- package/lib/esm/index.d.ts +10 -10
- package/lib/esm/index.js +10 -10
- package/lib/esm/state/index.d.ts +1 -1
- package/lib/esm/state/index.js +1 -1
- package/lib/esm/state/useStateUpdater.d.ts +3 -4
- package/lib/esm/state/useStateUpdater.js +11 -11
- package/lib/esm/useFieldBinding/index.d.ts +1 -1
- package/lib/esm/useFieldBinding/index.js +1 -1
- package/lib/esm/useFieldBinding/useFieldBinding.d.ts +2 -2
- package/lib/esm/useFieldBinding/useFieldBinding.js +17 -17
- package/lib/esm/useSharedQueryParams/index.d.ts +2 -2
- package/lib/esm/useSharedQueryParams/index.js +2 -2
- package/lib/esm/useSharedQueryParams/logic/index.d.ts +4 -4
- package/lib/esm/useSharedQueryParams/logic/index.js +4 -4
- package/lib/esm/useSharedQueryParams/logic/runtime/askSetParam.d.ts +2 -2
- package/lib/esm/useSharedQueryParams/logic/runtime/askSetParam.js +6 -6
- package/lib/esm/useSharedQueryParams/logic/runtime/askSyncParams.d.ts +2 -2
- package/lib/esm/useSharedQueryParams/logic/runtime/askSyncParams.js +8 -8
- package/lib/esm/useSharedQueryParams/logic/runtime/index.d.ts +2 -2
- package/lib/esm/useSharedQueryParams/logic/runtime/index.js +2 -2
- package/lib/esm/useSharedQueryParams/logic/runtime/sharedQueryParamsLogic.d.ts +4 -4
- package/lib/esm/useSharedQueryParams/logic/runtime/sharedQueryParamsLogic.js +4 -4
- package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsActionCreator.d.ts +2 -2
- package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsActionCreator.js +8 -8
- package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsReducer.d.ts +3 -3
- package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsReducer.js +10 -10
- package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsTypes.d.ts +10 -10
- package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsTypes.js +4 -4
- package/lib/esm/useSharedQueryParams/sharedQueryParamsRuntime.d.ts +3 -3
- package/lib/esm/useSharedQueryParams/sharedQueryParamsRuntime.js +4 -4
- package/lib/esm/webSocketQueue/hooks/index.d.ts +2 -2
- package/lib/esm/webSocketQueue/hooks/index.js +2 -2
- package/lib/esm/webSocketQueue/hooks/useSubscribeToWebSocketQueueEvent.d.ts +3 -3
- package/lib/esm/webSocketQueue/hooks/useSubscribeToWebSocketQueueEvent.js +4 -4
- package/lib/esm/webSocketQueue/hooks/useWebsocketQueueSendEvent.d.ts +2 -2
- package/lib/esm/webSocketQueue/hooks/useWebsocketQueueSendEvent.js +5 -5
- package/lib/esm/webSocketQueue/index.d.ts +1 -1
- package/lib/esm/webSocketQueue/index.js +1 -1
- package/lib/esm/websocket/WebSocketAuthSync/WebSocketAuthSync.d.ts +6 -7
- package/lib/esm/websocket/WebSocketAuthSync/WebSocketAuthSync.js +11 -11
- package/lib/esm/websocket/WebSocketAuthSync/hooks/index.d.ts +2 -2
- package/lib/esm/websocket/WebSocketAuthSync/hooks/index.js +2 -2
- package/lib/esm/websocket/WebSocketAuthSync/hooks/useWebsocketAuthSync.d.ts +2 -2
- package/lib/esm/websocket/WebSocketAuthSync/hooks/useWebsocketAuthSync.js +33 -33
- package/lib/esm/websocket/WebSocketAuthSync/hooks/useWebsocketPingPong.d.ts +1 -1
- package/lib/esm/websocket/WebSocketAuthSync/hooks/useWebsocketPingPong.js +12 -12
- package/lib/esm/websocket/WebSocketAuthSync/index.d.ts +1 -1
- package/lib/esm/websocket/WebSocketAuthSync/index.js +1 -1
- package/lib/esm/websocket/WebsocketContext.d.ts +2 -3
- package/lib/esm/websocket/WebsocketContext.js +2 -2
- package/lib/esm/websocket/WebsocketProvider.d.ts +5 -6
- package/lib/esm/websocket/WebsocketProvider.js +7 -7
- package/lib/esm/websocket/hooks/index.d.ts +5 -5
- package/lib/esm/websocket/hooks/index.js +5 -5
- package/lib/esm/websocket/hooks/useSubscribeToWebSocketEvent.d.ts +3 -3
- package/lib/esm/websocket/hooks/useSubscribeToWebSocketEvent.js +13 -13
- package/lib/esm/websocket/hooks/useSubscribeToWebsocket.d.ts +2 -2
- package/lib/esm/websocket/hooks/useSubscribeToWebsocket.js +13 -13
- package/lib/esm/websocket/hooks/useWebsocketApi.d.ts +1 -1
- package/lib/esm/websocket/hooks/useWebsocketApi.js +6 -6
- package/lib/esm/websocket/hooks/useWebsocketManagement.d.ts +2 -2
- package/lib/esm/websocket/hooks/useWebsocketManagement.js +13 -13
- package/lib/esm/websocket/hooks/useWebsocketSendEvent.d.ts +2 -2
- package/lib/esm/websocket/hooks/useWebsocketSendEvent.js +11 -11
- package/lib/esm/websocket/index.d.ts +3 -3
- package/lib/esm/websocket/index.js +3 -3
- package/package.json +8 -8
package/lib/esm/hooks/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './asmj';
|
|
2
|
-
export * from './useAsyncEffect';
|
|
3
|
-
export * from './useFastCallback';
|
|
4
|
-
export * from './useMetadata';
|
|
5
|
-
export * from './useOnKeyDownEffect';
|
|
6
|
-
export * from './useQpq';
|
|
7
|
-
export * from './useRunEvery';
|
|
8
|
-
export * from './useThrottledMemo';
|
|
1
|
+
export * from './asmj';
|
|
2
|
+
export * from './useAsyncEffect';
|
|
3
|
+
export * from './useFastCallback';
|
|
4
|
+
export * from './useMetadata';
|
|
5
|
+
export * from './useOnKeyDownEffect';
|
|
6
|
+
export * from './useQpq';
|
|
7
|
+
export * from './useRunEvery';
|
|
8
|
+
export * from './useThrottledMemo';
|
package/lib/esm/hooks/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './asmj';
|
|
2
|
-
export * from './useAsyncEffect';
|
|
3
|
-
export * from './useFastCallback';
|
|
4
|
-
export * from './useMetadata';
|
|
5
|
-
export * from './useOnKeyDownEffect';
|
|
6
|
-
export * from './useQpq';
|
|
7
|
-
export * from './useRunEvery';
|
|
8
|
-
export * from './useThrottledMemo';
|
|
1
|
+
export * from './asmj';
|
|
2
|
+
export * from './useAsyncEffect';
|
|
3
|
+
export * from './useFastCallback';
|
|
4
|
+
export * from './useMetadata';
|
|
5
|
+
export * from './useOnKeyDownEffect';
|
|
6
|
+
export * from './useQpq';
|
|
7
|
+
export * from './useRunEvery';
|
|
8
|
+
export * from './useThrottledMemo';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DependencyList } from 'react';
|
|
2
|
-
export declare const useAsyncEffect: (effect: (isMounted: () => boolean) => Promise<void | (() => void)>, deps?: DependencyList) => void;
|
|
1
|
+
import { DependencyList } from 'react';
|
|
2
|
+
export declare const useAsyncEffect: (effect: (isMounted: () => boolean) => Promise<void | (() => void)>, deps?: DependencyList) => void;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
export const useAsyncEffect = (effect, deps) => {
|
|
3
|
-
useEffect(() => {
|
|
4
|
-
const mountStatus = { mounted: true };
|
|
5
|
-
const runEffect = async () => {
|
|
6
|
-
try {
|
|
7
|
-
return await effect(() => mountStatus.mounted);
|
|
8
|
-
}
|
|
9
|
-
catch (error) {
|
|
10
|
-
console.error('Error in useAsyncEffect:', error);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
const result = runEffect();
|
|
14
|
-
return () => {
|
|
15
|
-
mountStatus.mounted = false;
|
|
16
|
-
result.then((callback) => {
|
|
17
|
-
if (callback) {
|
|
18
|
-
callback();
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
}, deps);
|
|
23
|
-
};
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
export const useAsyncEffect = (effect, deps) => {
|
|
3
|
+
useEffect(() => {
|
|
4
|
+
const mountStatus = { mounted: true };
|
|
5
|
+
const runEffect = async () => {
|
|
6
|
+
try {
|
|
7
|
+
return await effect(() => mountStatus.mounted);
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
console.error('Error in useAsyncEffect:', error);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const result = runEffect();
|
|
14
|
+
return () => {
|
|
15
|
+
mountStatus.mounted = false;
|
|
16
|
+
result.then((callback) => {
|
|
17
|
+
if (callback) {
|
|
18
|
+
callback();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
}, deps);
|
|
23
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DependencyList } from 'react';
|
|
2
|
-
export declare function useFastCallback<T extends Function>(callback: T, deps?: DependencyList): T;
|
|
1
|
+
import { DependencyList } from 'react';
|
|
2
|
+
export declare function useFastCallback<T extends Function>(callback: T, deps?: DependencyList): T;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { useCallback, useRef } from 'react';
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
3
|
-
export function useFastCallback(callback, deps) {
|
|
4
|
-
const callbackRef = useRef(callback);
|
|
5
|
-
const depsRef = useRef(deps);
|
|
6
|
-
// If the deps have changed, update the callback ref
|
|
7
|
-
// We support undefined deps, which means they are always updated
|
|
8
|
-
// This is different to [] where its never updated.
|
|
9
|
-
const hasDepsChanged = !depsRef.current || !deps || depsRef.current.some((dep, index) => dep !== deps[index]);
|
|
10
|
-
if (hasDepsChanged) {
|
|
11
|
-
callbackRef.current = callback;
|
|
12
|
-
}
|
|
13
|
-
depsRef.current = deps;
|
|
14
|
-
const memoFunc = useCallback((...args) => callbackRef.current(...args), []);
|
|
15
|
-
return memoFunc;
|
|
16
|
-
}
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
3
|
+
export function useFastCallback(callback, deps) {
|
|
4
|
+
const callbackRef = useRef(callback);
|
|
5
|
+
const depsRef = useRef(deps);
|
|
6
|
+
// If the deps have changed, update the callback ref
|
|
7
|
+
// We support undefined deps, which means they are always updated
|
|
8
|
+
// This is different to [] where its never updated.
|
|
9
|
+
const hasDepsChanged = !depsRef.current || !deps || depsRef.current.some((dep, index) => dep !== deps[index]);
|
|
10
|
+
if (hasDepsChanged) {
|
|
11
|
+
callbackRef.current = callback;
|
|
12
|
+
}
|
|
13
|
+
depsRef.current = deps;
|
|
14
|
+
const memoFunc = useCallback((...args) => callbackRef.current(...args), []);
|
|
15
|
+
return memoFunc;
|
|
16
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './useMetadata';
|
|
1
|
+
export * from './useMetadata';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './useMetadata';
|
|
1
|
+
export * from './useMetadata';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type MetadataGetter<M> = () => M | undefined;
|
|
2
|
-
type MetadataSetter<M> = (value: M) => void;
|
|
3
|
-
type UseMetadataReturn<M> = [MetadataGetter<M>, MetadataSetter<M>];
|
|
4
|
-
export declare function useMetadata<M>(key: object): UseMetadataReturn<M>;
|
|
5
|
-
export {};
|
|
1
|
+
type MetadataGetter<M> = () => M | undefined;
|
|
2
|
+
type MetadataSetter<M> = (value: M) => void;
|
|
3
|
+
type UseMetadataReturn<M> = [MetadataGetter<M>, MetadataSetter<M>];
|
|
4
|
+
export declare function useMetadata<M>(key: object): UseMetadataReturn<M>;
|
|
5
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
const metadataStore = new WeakMap();
|
|
3
|
-
export function useMetadata(key) {
|
|
4
|
-
return useMemo(() => {
|
|
5
|
-
const getMetadata = () => metadataStore.get(key);
|
|
6
|
-
const setMetadata = (value) => {
|
|
7
|
-
metadataStore.set(key, value);
|
|
8
|
-
};
|
|
9
|
-
return [getMetadata, setMetadata];
|
|
10
|
-
}, [key]);
|
|
11
|
-
}
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
const metadataStore = new WeakMap();
|
|
3
|
+
export function useMetadata(key) {
|
|
4
|
+
return useMemo(() => {
|
|
5
|
+
const getMetadata = () => metadataStore.get(key);
|
|
6
|
+
const setMetadata = (value) => {
|
|
7
|
+
metadataStore.set(key, value);
|
|
8
|
+
};
|
|
9
|
+
return [getMetadata, setMetadata];
|
|
10
|
+
}, [key]);
|
|
11
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useOnKeyDownEffect(targetKey: KeyboardEvent['key'], isActive: boolean, callback?: () => void): void;
|
|
1
|
+
export declare function useOnKeyDownEffect(targetKey: KeyboardEvent['key'], isActive: boolean, callback?: () => void): void;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
export function useOnKeyDownEffect(targetKey, isActive, callback) {
|
|
3
|
-
useEffect(() => {
|
|
4
|
-
if (!isActive || !callback) {
|
|
5
|
-
return () => {
|
|
6
|
-
// NOOP
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
const handleKeyDown = (event) => {
|
|
10
|
-
if (event.key === targetKey) {
|
|
11
|
-
callback();
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
15
|
-
return () => {
|
|
16
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
17
|
-
};
|
|
18
|
-
}, [targetKey, isActive, callback]);
|
|
19
|
-
}
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
export function useOnKeyDownEffect(targetKey, isActive, callback) {
|
|
3
|
+
useEffect(() => {
|
|
4
|
+
if (!isActive || !callback) {
|
|
5
|
+
return () => {
|
|
6
|
+
// NOOP
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
const handleKeyDown = (event) => {
|
|
10
|
+
if (event.key === targetKey) {
|
|
11
|
+
callback();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
15
|
+
return () => {
|
|
16
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
17
|
+
};
|
|
18
|
+
}, [targetKey, isActive, callback]);
|
|
19
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ActionProcessorListResolver, StoryResolver } from 'quidproquo-core';
|
|
2
|
-
export declare function useQpq(getActionProcessors?: ActionProcessorListResolver): StoryResolver;
|
|
1
|
+
import { ActionProcessorListResolver, StoryResolver } from 'quidproquo-core';
|
|
2
|
+
export declare function useQpq(getActionProcessors?: ActionProcessorListResolver): StoryResolver;
|
package/lib/esm/hooks/useQpq.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { getWebActionProcessors } from 'quidproquo-actionprocessor-web';
|
|
2
|
-
import { createRuntime, defineModule, QpqRuntimeType, } from 'quidproquo-core';
|
|
3
|
-
import { useCallback, useMemo } from 'react';
|
|
4
|
-
import { useQpqContextValues } from './asmj';
|
|
5
|
-
// WIP ~ useFastCallback, wack things like loggers in a context, try to only make once instance of the runtime.
|
|
6
|
-
// Also don't create every refresh.. useMemo / useCallback etc
|
|
7
|
-
const logger = {
|
|
8
|
-
enableLogs: async () => { },
|
|
9
|
-
log: async () => { },
|
|
10
|
-
waitToFinishWriting: async () => { },
|
|
11
|
-
moveToPermanentStorage: async () => { },
|
|
12
|
-
};
|
|
13
|
-
export function useQpq(getActionProcessors = async () => ({})) {
|
|
14
|
-
const qpqContextValues = useQpqContextValues();
|
|
15
|
-
const resolveStory = useMemo(() => createRuntime([defineModule('UI')], {
|
|
16
|
-
depth: 0,
|
|
17
|
-
context: qpqContextValues,
|
|
18
|
-
}, async (qpqConfig, dynamicModuleLoader) => ({
|
|
19
|
-
...(await getWebActionProcessors(qpqConfig, dynamicModuleLoader)),
|
|
20
|
-
...(await getActionProcessors(qpqConfig, dynamicModuleLoader)),
|
|
21
|
-
}), () => new Date().toISOString(), logger, `frontend::${'uuid'}`, QpqRuntimeType.UI, async (_runtime) => {
|
|
22
|
-
// noop
|
|
23
|
-
}), [qpqContextValues]);
|
|
24
|
-
const qpq = useCallback(function getStoryExecutor(story) {
|
|
25
|
-
return async (...args) => {
|
|
26
|
-
const result = await resolveStory(story, args);
|
|
27
|
-
if (result.error) {
|
|
28
|
-
throw new Error(result.error.errorText);
|
|
29
|
-
}
|
|
30
|
-
return result.result;
|
|
31
|
-
};
|
|
32
|
-
}, [resolveStory]);
|
|
33
|
-
return qpq;
|
|
34
|
-
}
|
|
1
|
+
import { getWebActionProcessors } from 'quidproquo-actionprocessor-web';
|
|
2
|
+
import { createRuntime, defineModule, QpqRuntimeType, } from 'quidproquo-core';
|
|
3
|
+
import { useCallback, useMemo } from 'react';
|
|
4
|
+
import { useQpqContextValues } from './asmj';
|
|
5
|
+
// WIP ~ useFastCallback, wack things like loggers in a context, try to only make once instance of the runtime.
|
|
6
|
+
// Also don't create every refresh.. useMemo / useCallback etc
|
|
7
|
+
const logger = {
|
|
8
|
+
enableLogs: async () => { },
|
|
9
|
+
log: async () => { },
|
|
10
|
+
waitToFinishWriting: async () => { },
|
|
11
|
+
moveToPermanentStorage: async () => { },
|
|
12
|
+
};
|
|
13
|
+
export function useQpq(getActionProcessors = async () => ({})) {
|
|
14
|
+
const qpqContextValues = useQpqContextValues();
|
|
15
|
+
const resolveStory = useMemo(() => createRuntime([defineModule('UI')], {
|
|
16
|
+
depth: 0,
|
|
17
|
+
context: qpqContextValues,
|
|
18
|
+
}, async (qpqConfig, dynamicModuleLoader) => ({
|
|
19
|
+
...(await getWebActionProcessors(qpqConfig, dynamicModuleLoader)),
|
|
20
|
+
...(await getActionProcessors(qpqConfig, dynamicModuleLoader)),
|
|
21
|
+
}), () => new Date().toISOString(), logger, `frontend::${'uuid'}`, QpqRuntimeType.UI, async (_runtime) => {
|
|
22
|
+
// noop
|
|
23
|
+
}), [qpqContextValues]);
|
|
24
|
+
const qpq = useCallback(function getStoryExecutor(story) {
|
|
25
|
+
return async (...args) => {
|
|
26
|
+
const result = await resolveStory(story, args);
|
|
27
|
+
if (result.error) {
|
|
28
|
+
throw new Error(result.error.errorText);
|
|
29
|
+
}
|
|
30
|
+
return result.result;
|
|
31
|
+
};
|
|
32
|
+
}, [resolveStory]);
|
|
33
|
+
return qpq;
|
|
34
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useRunEvery<T>(func: () => T, intervalSeconds: number): T;
|
|
1
|
+
export declare function useRunEvery<T>(func: () => T, intervalSeconds: number): T;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
export function useRunEvery(func, intervalSeconds) {
|
|
3
|
-
const [value, setValue] = useState(func);
|
|
4
|
-
const intervalRef = useRef(null);
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
intervalRef.current = window.setInterval(() => {
|
|
7
|
-
const newValue = func();
|
|
8
|
-
setValue(newValue);
|
|
9
|
-
}, intervalSeconds * 1000);
|
|
10
|
-
return () => {
|
|
11
|
-
if (intervalRef.current !== null) {
|
|
12
|
-
window.clearInterval(intervalRef.current);
|
|
13
|
-
intervalRef.current = null;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}, [intervalSeconds]);
|
|
17
|
-
return value;
|
|
18
|
-
}
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
export function useRunEvery(func, intervalSeconds) {
|
|
3
|
+
const [value, setValue] = useState(func);
|
|
4
|
+
const intervalRef = useRef(null);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
intervalRef.current = window.setInterval(() => {
|
|
7
|
+
const newValue = func();
|
|
8
|
+
setValue(newValue);
|
|
9
|
+
}, intervalSeconds * 1000);
|
|
10
|
+
return () => {
|
|
11
|
+
if (intervalRef.current !== null) {
|
|
12
|
+
window.clearInterval(intervalRef.current);
|
|
13
|
+
intervalRef.current = null;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}, [intervalSeconds]);
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useThrottledMemo<T>(factory: () => T, deps: any[], delaySeconds?: number): T;
|
|
1
|
+
export declare function useThrottledMemo<T>(factory: () => T, deps: any[], delaySeconds?: number): T;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
export function useThrottledMemo(factory, deps, delaySeconds = 1) {
|
|
3
|
-
const [value, setValue] = useState(factory);
|
|
4
|
-
const isFirstRun = useRef(true);
|
|
5
|
-
const timeoutRef = useRef(null);
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
// This skips the throttling on the initial mount
|
|
8
|
-
if (isFirstRun.current) {
|
|
9
|
-
isFirstRun.current = false;
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
if (timeoutRef.current) {
|
|
13
|
-
clearTimeout(timeoutRef.current);
|
|
14
|
-
}
|
|
15
|
-
timeoutRef.current = setTimeout(() => {
|
|
16
|
-
setValue(factory);
|
|
17
|
-
timeoutRef.current = null;
|
|
18
|
-
}, delaySeconds * 1000);
|
|
19
|
-
// Cleanup on component unmount or when dependencies change
|
|
20
|
-
return () => {
|
|
21
|
-
if (timeoutRef.current) {
|
|
22
|
-
clearTimeout(timeoutRef.current);
|
|
23
|
-
timeoutRef.current = null;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}, [...deps, delaySeconds]);
|
|
27
|
-
return value;
|
|
28
|
-
}
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
export function useThrottledMemo(factory, deps, delaySeconds = 1) {
|
|
3
|
+
const [value, setValue] = useState(factory);
|
|
4
|
+
const isFirstRun = useRef(true);
|
|
5
|
+
const timeoutRef = useRef(null);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
// This skips the throttling on the initial mount
|
|
8
|
+
if (isFirstRun.current) {
|
|
9
|
+
isFirstRun.current = false;
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (timeoutRef.current) {
|
|
13
|
+
clearTimeout(timeoutRef.current);
|
|
14
|
+
}
|
|
15
|
+
timeoutRef.current = setTimeout(() => {
|
|
16
|
+
setValue(factory);
|
|
17
|
+
timeoutRef.current = null;
|
|
18
|
+
}, delaySeconds * 1000);
|
|
19
|
+
// Cleanup on component unmount or when dependencies change
|
|
20
|
+
return () => {
|
|
21
|
+
if (timeoutRef.current) {
|
|
22
|
+
clearTimeout(timeoutRef.current);
|
|
23
|
+
timeoutRef.current = null;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}, [...deps, delaySeconds]);
|
|
27
|
+
return value;
|
|
28
|
+
}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import 'symbol-observable';
|
|
2
|
-
export * from './api';
|
|
3
|
-
export * from './auth';
|
|
4
|
-
export * from './baseUrl';
|
|
5
|
-
export * from './hooks';
|
|
6
|
-
export * from './state';
|
|
7
|
-
export * from './useFieldBinding';
|
|
8
|
-
export * from './useSharedQueryParams';
|
|
9
|
-
export * from './websocket';
|
|
10
|
-
export * from './webSocketQueue';
|
|
1
|
+
import 'symbol-observable';
|
|
2
|
+
export * from './api';
|
|
3
|
+
export * from './auth';
|
|
4
|
+
export * from './baseUrl';
|
|
5
|
+
export * from './hooks';
|
|
6
|
+
export * from './state';
|
|
7
|
+
export * from './useFieldBinding';
|
|
8
|
+
export * from './useSharedQueryParams';
|
|
9
|
+
export * from './websocket';
|
|
10
|
+
export * from './webSocketQueue';
|
package/lib/esm/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import 'symbol-observable';
|
|
2
|
-
export * from './api';
|
|
3
|
-
export * from './auth';
|
|
4
|
-
export * from './baseUrl';
|
|
5
|
-
export * from './hooks';
|
|
6
|
-
export * from './state';
|
|
7
|
-
export * from './useFieldBinding';
|
|
8
|
-
export * from './useSharedQueryParams';
|
|
9
|
-
export * from './websocket';
|
|
10
|
-
export * from './webSocketQueue';
|
|
1
|
+
import 'symbol-observable';
|
|
2
|
+
export * from './api';
|
|
3
|
+
export * from './auth';
|
|
4
|
+
export * from './baseUrl';
|
|
5
|
+
export * from './hooks';
|
|
6
|
+
export * from './state';
|
|
7
|
+
export * from './useFieldBinding';
|
|
8
|
+
export * from './useSharedQueryParams';
|
|
9
|
+
export * from './websocket';
|
|
10
|
+
export * from './webSocketQueue';
|
package/lib/esm/state/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './useStateUpdater';
|
|
1
|
+
export * from './useStateUpdater';
|
package/lib/esm/state/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './useStateUpdater';
|
|
1
|
+
export * from './useStateUpdater';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export {};
|
|
1
|
+
type UpdaterFunction<T> = (property: keyof T) => (value: T[keyof T]) => void;
|
|
2
|
+
export declare const useStateUpdater: <T>(setState: React.Dispatch<React.SetStateAction<T>>) => UpdaterFunction<T>;
|
|
3
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useFastCallback } from '../hooks';
|
|
2
|
-
export const useStateUpdater = (setState) => {
|
|
3
|
-
return useFastCallback((property) => {
|
|
4
|
-
return (value) => {
|
|
5
|
-
setState((prevState) => ({
|
|
6
|
-
...prevState,
|
|
7
|
-
[property]: value,
|
|
8
|
-
}));
|
|
9
|
-
};
|
|
10
|
-
}, [setState]);
|
|
11
|
-
};
|
|
1
|
+
import { useFastCallback } from '../hooks';
|
|
2
|
+
export const useStateUpdater = (setState) => {
|
|
3
|
+
return useFastCallback((property) => {
|
|
4
|
+
return (value) => {
|
|
5
|
+
setState((prevState) => ({
|
|
6
|
+
...prevState,
|
|
7
|
+
[property]: value,
|
|
8
|
+
}));
|
|
9
|
+
};
|
|
10
|
+
}, [setState]);
|
|
11
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './useFieldBinding';
|
|
1
|
+
export * from './useFieldBinding';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './useFieldBinding';
|
|
1
|
+
export * from './useFieldBinding';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QpqRuntimeComputed } from '../hooks';
|
|
2
|
-
export declare const useFieldBinding: <TState, V, E = any>(computedAtom: QpqRuntimeComputed<TState, V>, someSetter: (value: V) => Promise<void> | void, valueExtractor?: (
|
|
1
|
+
import { QpqRuntimeComputed } from '../hooks';
|
|
2
|
+
export declare const useFieldBinding: <TState, V, E = any>(computedAtom: QpqRuntimeComputed<TState, V>, someSetter: (value: V) => Promise<void> | void, valueExtractor?: (event: E, ...args: any[]) => V) => [V, (event: E, ...args: any[]) => void];
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import { useQpqRuntimeComputed } from '../hooks';
|
|
3
|
-
export const useFieldBinding = (computedAtom, someSetter, valueExtractor) => {
|
|
4
|
-
const computedValue = useQpqRuntimeComputed(computedAtom);
|
|
5
|
-
const [value, setValue] = useState(computedValue);
|
|
6
|
-
const handleChange = (event, ...args) => {
|
|
7
|
-
const newValue = valueExtractor ? valueExtractor(event, ...args) : event.target.value;
|
|
8
|
-
setValue(newValue);
|
|
9
|
-
someSetter(newValue);
|
|
10
|
-
};
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
if (computedValue !== value) {
|
|
13
|
-
setValue(computedValue);
|
|
14
|
-
}
|
|
15
|
-
}, [computedValue]);
|
|
16
|
-
return [value, handleChange];
|
|
17
|
-
};
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useQpqRuntimeComputed } from '../hooks';
|
|
3
|
+
export const useFieldBinding = (computedAtom, someSetter, valueExtractor) => {
|
|
4
|
+
const computedValue = useQpqRuntimeComputed(computedAtom);
|
|
5
|
+
const [value, setValue] = useState(computedValue);
|
|
6
|
+
const handleChange = (event, ...args) => {
|
|
7
|
+
const newValue = valueExtractor ? valueExtractor(event, ...args) : event.target.value;
|
|
8
|
+
setValue(newValue);
|
|
9
|
+
someSetter(newValue);
|
|
10
|
+
};
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (computedValue !== value) {
|
|
13
|
+
setValue(computedValue);
|
|
14
|
+
}
|
|
15
|
+
}, [computedValue]);
|
|
16
|
+
return [value, handleChange];
|
|
17
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './logic';
|
|
2
|
-
export * from './sharedQueryParamsRuntime';
|
|
1
|
+
export * from './logic';
|
|
2
|
+
export * from './sharedQueryParamsRuntime';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './logic';
|
|
2
|
-
export * from './sharedQueryParamsRuntime';
|
|
1
|
+
export * from './logic';
|
|
2
|
+
export * from './sharedQueryParamsRuntime';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './runtime';
|
|
2
|
-
export * from './sharedQueryParamsActionCreator';
|
|
3
|
-
export * from './sharedQueryParamsReducer';
|
|
4
|
-
export * from './sharedQueryParamsTypes';
|
|
1
|
+
export * from './runtime';
|
|
2
|
+
export * from './sharedQueryParamsActionCreator';
|
|
3
|
+
export * from './sharedQueryParamsReducer';
|
|
4
|
+
export * from './sharedQueryParamsTypes';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './runtime';
|
|
2
|
-
export * from './sharedQueryParamsActionCreator';
|
|
3
|
-
export * from './sharedQueryParamsReducer';
|
|
4
|
-
export * from './sharedQueryParamsTypes';
|
|
1
|
+
export * from './runtime';
|
|
2
|
+
export * from './sharedQueryParamsActionCreator';
|
|
3
|
+
export * from './sharedQueryParamsReducer';
|
|
4
|
+
export * from './sharedQueryParamsTypes';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AskResponse } from 'quidproquo-core';
|
|
2
|
-
export declare function askSetParam(key: string, values: string[]): AskResponse<void>;
|
|
1
|
+
import { AskResponse } from 'quidproquo-core';
|
|
2
|
+
export declare function askSetParam(key: string, values: string[]): AskResponse<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { askQueryParamsSet } from 'quidproquo-web';
|
|
2
|
-
import { askSharedQueryParamsUISetParam } from '../sharedQueryParamsActionCreator';
|
|
3
|
-
export function* askSetParam(key, values) {
|
|
4
|
-
yield* askQueryParamsSet(key, values, false);
|
|
5
|
-
yield* askSharedQueryParamsUISetParam(key, values);
|
|
6
|
-
}
|
|
1
|
+
import { askQueryParamsSet } from 'quidproquo-web';
|
|
2
|
+
import { askSharedQueryParamsUISetParam } from '../sharedQueryParamsActionCreator';
|
|
3
|
+
export function* askSetParam(key, values) {
|
|
4
|
+
yield* askQueryParamsSet(key, values, false);
|
|
5
|
+
yield* askSharedQueryParamsUISetParam(key, values);
|
|
6
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AskResponse } from 'quidproquo-core';
|
|
2
|
-
export declare function askSyncParams(): AskResponse<void>;
|
|
1
|
+
import { AskResponse } from 'quidproquo-core';
|
|
2
|
+
export declare function askSyncParams(): AskResponse<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { askQueryParamsGetAll } from 'quidproquo-web';
|
|
2
|
-
import { askSharedQueryParamsUISetParam } from '../sharedQueryParamsActionCreator';
|
|
3
|
-
export function* askSyncParams() {
|
|
4
|
-
const params = yield* askQueryParamsGetAll();
|
|
5
|
-
for (const key in params) {
|
|
6
|
-
yield* askSharedQueryParamsUISetParam(key, params[key]);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
1
|
+
import { askQueryParamsGetAll } from 'quidproquo-web';
|
|
2
|
+
import { askSharedQueryParamsUISetParam } from '../sharedQueryParamsActionCreator';
|
|
3
|
+
export function* askSyncParams() {
|
|
4
|
+
const params = yield* askQueryParamsGetAll();
|
|
5
|
+
for (const key in params) {
|
|
6
|
+
yield* askSharedQueryParamsUISetParam(key, params[key]);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './askSyncParams';
|
|
2
|
-
export * from './sharedQueryParamsLogic';
|
|
1
|
+
export * from './askSyncParams';
|
|
2
|
+
export * from './sharedQueryParamsLogic';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './askSyncParams';
|
|
2
|
-
export * from './sharedQueryParamsLogic';
|
|
1
|
+
export * from './askSyncParams';
|
|
2
|
+
export * from './sharedQueryParamsLogic';
|