init
This commit is contained in:
commit
ec53fcbe95
1905 changed files with 513762 additions and 0 deletions
17
hooks/useAfterFirstRender.ts
Normal file
17
hooks/useAfterFirstRender.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { useEffect } from 'react'
|
||||
import { isEnvTruthy } from '../utils/envUtils.js'
|
||||
|
||||
export function useAfterFirstRender(): void {
|
||||
useEffect(() => {
|
||||
if (
|
||||
process.env.USER_TYPE === 'ant' &&
|
||||
isEnvTruthy(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)
|
||||
) {
|
||||
process.stderr.write(
|
||||
`\nStartup time: ${Math.round(process.uptime() * 1000)}ms\n`,
|
||||
)
|
||||
// eslint-disable-next-line custom-rules/no-process-exit
|
||||
process.exit(0)
|
||||
}
|
||||
}, [])
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue