This repository has been archived by the owner on Mar 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The most significant changes were made to the
Detail.tsx
, Get.ts
,…
… and `SignalR.ts` files. In `Detail.tsx`, the import statement was updated to include `SkeletonItem` from `@fluentui/react-components` and a `loading` state was added to the `DeferredBody` function. The `Get.ts` file was updated to use `useAsyncEffect` from `ahooks` for handling asynchronous operations. The `SignalR.ts` file saw changes in the `update` function, including the addition of a `setCache` function and changes to the conditions for updating the cache. 1. In `Detail.tsx`, the import statement was updated to include `SkeletonItem` from `@fluentui/react-components`. The `DeferredBody` function was updated to include a `loading` state from `Hub.Order.Get.useItems`. A `run` function was also added to run `runItems` and `runOrder` together. A `SkeletonItem` component was added to the JSX returned by the `DeferredBody` function to display a loading state. 2. In `Get.ts`, the import statement was updated to include `useAsyncEffect` from `ahooks`. The `OrderGet` class was updated to use `useAsyncEffect` to handle the asynchronous operations previously handled in the `onSuccess` callback. The logic within the `onSuccess` callback was moved into the `useAsyncEffect` hook. 3. In `SignalR.ts`, the `update` function within the `SignalR` class was updated to include a `setCache` function that sets a cache with a `QueryExp` value 10 seconds in the future. The `setCache` function was also updated to delete the cache if the response is null. The condition to update the cache was changed from `find.QueryExp <= dayjs().unix()` to `find.QueryExp < dayjs().unix()`. The `setCache` function that was previously outside the `update` function was removed. The `useRequest` function was updated to have a `staleTime` of 5000 instead of 1000.
- Loading branch information
Showing
3 changed files
with
71 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters