github-actions[bot]
2 years ago
committed by
GitHub
17 changed files with 190 additions and 64 deletions
@ -0,0 +1,17 @@ |
|||
import { startTransition, useState } from 'react'; |
|||
|
|||
const useLayoutState = <S>( |
|||
...args: Parameters<typeof useState<S>> |
|||
): ReturnType<typeof useState<S>> => { |
|||
const [state, setState] = useState<S>(...args); |
|||
|
|||
const setLayoutState: typeof setState = (...setStateArgs) => { |
|||
startTransition(() => { |
|||
setState(...setStateArgs); |
|||
}); |
|||
}; |
|||
|
|||
return [state, setLayoutState]; |
|||
}; |
|||
|
|||
export default useLayoutState; |
@ -0,0 +1,23 @@ |
|||
name: 🤖 ChatGPT Code Review |
|||
|
|||
permissions: |
|||
contents: read |
|||
pull-requests: write |
|||
|
|||
on: |
|||
pull_request: |
|||
types: [opened, reopened, synchronize] |
|||
|
|||
jobs: |
|||
test: |
|||
runs-on: ubuntu-latest |
|||
steps: |
|||
- uses: anc95/ChatGPT-CodeReview@main |
|||
env: |
|||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
|||
# Optional |
|||
LANGUAGE: Chinese |
|||
MODEL: |
|||
top_p: 1 |
|||
temperature: 1 |
Loading…
Reference in new issue