-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from depromeet/feat/async
feat: 비동기 처리를 위한 유틸 함수 구현
- Loading branch information
Showing
50 changed files
with
689 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: CI 체크중.. | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 레포지토리 체크아웃 중.. | ||
uses: actions/checkout@v2 | ||
|
||
- name: node 설치중.. | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '20.2.0' | ||
|
||
- name: yarn 설치중.. | ||
run: npm install -g yarn | ||
|
||
- name: 종속성 설치중... | ||
run: yarn install | ||
|
||
- name: 빌드 중.. | ||
run: yarn build |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.71 MB
.yarn/cache/@img-sharp-libvips-darwin-arm64-npm-1.0.2-6c9ede770e-8.zip
Binary file not shown.
Binary file removed
BIN
-7.54 MB
.yarn/cache/@img-sharp-libvips-darwin-x64-npm-1.0.2-01b146c37d-8.zip
Binary file not shown.
Binary file renamed
BIN
+35.7 MB
...wc-darwin-x64-npm-14.2.4-56f1600da7-8.zip → ...-darwin-arm64-npm-14.2.4-86d534c3ee-8.zip
Binary file not shown.
Binary file added
BIN
+4.75 KB
.yarn/cache/class-variance-authority-npm-0.7.0-1a63840197-e7fd1fab43.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"$schema": "https://ui.shadcn.com/schema.json", | ||
"style": "default", | ||
"rsc": true, | ||
"tsx": true, | ||
"tailwind": { | ||
"config": "tailwind.config.ts", | ||
"css": "src/app/globals.css", | ||
"baseColor": "slate", | ||
"cssVariables": false, | ||
"prefix": "" | ||
}, | ||
"aliases": { | ||
"components": "@/components", | ||
"utils": "@/util" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './useIsClient'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use client'; | ||
|
||
import { useSyncExternalStore } from 'react'; | ||
|
||
export function useIsClient() { | ||
return useSyncExternalStore( | ||
() => () => {}, | ||
() => true, | ||
() => false, | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
'use client'; | ||
|
||
import { forwardRef } from 'react'; | ||
import { useQueryErrorResetBoundary } from '@tanstack/react-query'; | ||
import { chain } from '@/utils'; | ||
import { ErrorBoundary } from '../ErrorBoundary/ErrorBoundary'; | ||
import SSRSafeSuspense from '../SSRSafeSuspense/SSRSafeSuspense'; | ||
import type { StrictPropsWithChildren } from '@/types'; | ||
import type { ComponentProps, ComponentRef, Suspense } from 'react'; | ||
|
||
type ErrorBoundaryProps = Omit<ComponentProps<typeof ErrorBoundary>, 'renderFallback'>; | ||
type SuspenseProps = Omit<ComponentProps<typeof Suspense>, 'fallback'>; | ||
|
||
type AsyncBoundrayProps = StrictPropsWithChildren & | ||
ErrorBoundaryProps & | ||
SuspenseProps & { | ||
errorFallback?: ComponentProps<typeof ErrorBoundary>['renderFallback']; | ||
pendingFallback?: ComponentProps<typeof Suspense>['fallback']; | ||
}; | ||
|
||
export const AsyncBoundary = forwardRef<ComponentRef<typeof ErrorBoundary>, AsyncBoundrayProps>( | ||
({ errorFallback, pendingFallback, children, ...errorBoundaryProps }, ref) => { | ||
return ( | ||
<ErrorBoundary ref={ref} renderFallback={errorFallback} {...errorBoundaryProps}> | ||
<SSRSafeSuspense fallback={pendingFallback}>{children}</SSRSafeSuspense> | ||
</ErrorBoundary> | ||
); | ||
}, | ||
); | ||
|
||
AsyncBoundary.displayName = 'AsyncBoundary'; | ||
|
||
export const AsyncBoundaryWithQuery = forwardRef<ComponentRef<typeof ErrorBoundary>, AsyncBoundrayProps>( | ||
(props, ref) => { | ||
const { children, ...otherProps } = props; | ||
const { reset } = useQueryErrorResetBoundary(); | ||
|
||
return ( | ||
<AsyncBoundary ref={ref} {...otherProps} onReset={chain(props.onReset, reset)}> | ||
{children} | ||
</AsyncBoundary> | ||
); | ||
}, | ||
); | ||
|
||
AsyncBoundaryWithQuery.displayName = 'AsyncBoundaryWithQuery'; |
Oops, something went wrong.