Skip to content

Commit

Permalink
docs: modify docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiboss committed Jun 18, 2024
1 parent ea8efbb commit 889bcf5
Show file tree
Hide file tree
Showing 13 changed files with 683 additions and 319 deletions.
2 changes: 1 addition & 1 deletion scripts/update-hooks-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import url from 'node:url'
// TODO: re-write use import.meta.dirname
const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
const srcDir = path.resolve(__dirname, '../src')
const targetPath = path.resolve(__dirname, '../website/src/pages/search/hooks.json')
const targetPath = path.resolve(__dirname, '../website/src/pages/components/search/hooks.json')

const dirents = fs
.readdirSync(srcDir, { withFileTypes: true })
Expand Down
2 changes: 2 additions & 0 deletions src/use-lorem-ipsum/demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import { useLoremIpsum, useRender } from '@shined/use'
export function App() {
const render = useRender()
const lorem = useLoremIpsum()
const lorem2 = useLoremIpsum(2)
const randomLorem = useLoremIpsum({ stable: false })

return (
<Card>
<KeyValue label="Stable lorem ipsum" value={lorem} />
<KeyValue label="Stable lorem ipsum 2" value={lorem2} />
<KeyValue label="Random lorem ipsum" value={randomLorem} />
<Button onClick={render}>Rerender</Button>
</Card>
Expand Down
3 changes: 0 additions & 3 deletions src/use-tracked-effect/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useRef } from 'react'
import { useLatest } from '../use-latest'
import { useUpdateEffect } from '../use-update-effect'
import { isDev } from '../utils/basic'

import type { DependencyList as Deps } from 'react'

Expand All @@ -13,8 +12,6 @@ export function useTrackedEffect(callback: TrackedEffectCallback, deps?: Deps) {

// biome-ignore lint/correctness/useExhaustiveDependencies: for dev
useUpdateEffect(() => {
if (!isDev) return // only run in development mode

const depIndexes = findChangedIndexes(previousDepsRef.current, deps)

const previousDeps = previousDepsRef.current
Expand Down
5 changes: 0 additions & 5 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ export default {
label: 'Changelog',
position: 'left',
},
{
to: '/search',
label: 'Hooks',
position: 'right',
},
{
href: 'https://github.com/sheinsight/use',
label: 'GitHub',
Expand Down
4 changes: 2 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
"@docusaurus/module-type-aliases": "3.3.2",
"@docusaurus/tsconfig": "3.3.2",
"@docusaurus/types": "3.3.2",
"@unocss/postcss": "^0.59.4",
"@unocss/postcss": "^0.61.0",
"gray-matter": "^4.0.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "~5.2.2",
"unocss": "^0.59.4"
"unocss": "^0.61.0"
},
"browserslist": {
"production": [
Expand Down
Loading

0 comments on commit 889bcf5

Please sign in to comment.