|
1 | | -# Turborepo starter |
| 1 | +<div align="center"> |
| 2 | +<h1>tiny-react-hooks</h1> |
| 3 | +<div>A React hook library, written in Typescript.</div> |
| 4 | +<br /> |
| 5 | +<div align="center"> |
| 6 | + <sub>Created by <a href="https://github.com/tuananhl">Tuan Anh</a>.</sub> |
| 7 | +</div> |
2 | 8 |
|
3 | | -This Turborepo starter is maintained by the Turborepo core team. |
| 9 | +</div> |
| 10 | +<br /> |
4 | 11 |
|
5 | | -## Using this example |
| 12 | +## 💫 Introduction |
6 | 13 |
|
7 | | -Run the following command: |
| 14 | +This is a React hooks library, written in Typescript and easy to use. It provides a set of hooks that enables you to build your React applications faster. There are hooks for most common use cases you might need. |
8 | 15 |
|
9 | | -```sh |
10 | | -npx create-turbo@latest |
11 | | -``` |
12 | | - |
13 | | -## What's inside? |
14 | | - |
15 | | -This Turborepo includes the following packages/apps: |
16 | | - |
17 | | -### Apps and Packages |
18 | | - |
19 | | -- `docs`: a [Next.js](https://nextjs.org/) app |
20 | | -- `web`: another [Next.js](https://nextjs.org/) app |
21 | | -- `@repo/ui`: a stub React component library shared by both `web` and `docs` applications |
22 | | -- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`) |
23 | | -- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo |
24 | | - |
25 | | -Each package/app is 100% [TypeScript](https://www.typescriptlang.org/). |
26 | | - |
27 | | -### Utilities |
28 | | - |
29 | | -This Turborepo has some additional tools already setup for you: |
30 | | - |
31 | | -- [TypeScript](https://www.typescriptlang.org/) for static type checking |
32 | | -- [ESLint](https://eslint.org/) for code linting |
33 | | -- [Prettier](https://prettier.io) for code formatting |
34 | | - |
35 | | -### Build |
36 | | - |
37 | | -To build all apps and packages, run the following command: |
38 | | - |
39 | | -``` |
40 | | -cd my-turborepo |
41 | | -pnpm build |
42 | | -``` |
| 16 | +### Usage example |
43 | 17 |
|
44 | | -### Develop |
| 18 | +```tsx |
| 19 | +import { useDisclosure } from 'tiny-react-hooks' // might be deploy in the future |
45 | 20 |
|
46 | | -To develop all apps and packages, run the following command: |
| 21 | +function Component() { |
| 22 | + const { isOpen, onOpen, onClose, onToggle } = useDisclosure(); |
47 | 23 |
|
| 24 | + // ... |
| 25 | +} |
48 | 26 | ``` |
49 | | -cd my-turborepo |
50 | | -pnpm dev |
51 | | -``` |
52 | | - |
53 | | -### Remote Caching |
54 | | - |
55 | | -> [!TIP] |
56 | | -> Vercel Remote Cache is free for all plans. Get started today at [vercel.com](https://vercel.com/signup?/signup?utm_source=remote-cache-sdk&utm_campaign=free_remote_cache). |
57 | | -
|
58 | | -Turborepo can use a technique known as [Remote Caching](https://turbo.build/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines. |
59 | | - |
60 | | -By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup?utm_source=turborepo-examples), then enter the following commands: |
61 | | - |
62 | | -``` |
63 | | -cd my-turborepo |
64 | | -npx turbo login |
65 | | -``` |
66 | | - |
67 | | -This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview). |
68 | | - |
69 | | -Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo: |
70 | | - |
71 | | -``` |
72 | | -npx turbo link |
73 | | -``` |
74 | | - |
75 | | -## Useful Links |
| 27 | +## 🪝 Available Hooks |
76 | 28 |
|
77 | | -Learn more about the power of Turborepo: |
| 29 | +<!-- HOOKS:START --> |
78 | 30 |
|
79 | | -- [Tasks](https://turbo.build/docs/core-concepts/monorepos/running-tasks) |
80 | | -- [Caching](https://turbo.build/docs/core-concepts/caching) |
81 | | -- [Remote Caching](https://turbo.build/docs/core-concepts/remote-caching) |
82 | | -- [Filtering](https://turbo.build/docs/core-concepts/monorepos/filtering) |
83 | | -- [Configuration Options](https://turbo.build/docs/reference/configuration) |
84 | | -- [CLI Usage](https://turbo.build/docs/reference/command-line-reference) |
| 31 | +- [`useDisclosure`] — handles boolean state with useful utility functions. |
| 32 | +<!-- HOOKS:END --> |
0 commit comments