Skip to content

Commit

Permalink
Add [use-local-storage] hook (#38)
Browse files Browse the repository at this point in the history
* Add hook and tests

* Add test

* chore

* docs(changeset): Add [use-local-storage] hook

* Add docs
  • Loading branch information
mhdcodes authored Aug 22, 2024
1 parent 4578af3 commit 3e25e8e
Show file tree
Hide file tree
Showing 11 changed files with 343 additions and 80 deletions.
5 changes: 5 additions & 0 deletions .changeset/lazy-ears-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@codiume/hooks": patch
---

Add [use-local-storage] hook
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ yarn add @codiume/hooks

## Hooks

| Hook | Description |
| -------------------------------------------- | ---------------------------------------------- |
| [use-in-viewport](./src/use-in-viewport) | Detects if element is visible in the viewport |
| [use-queue](./src/use-queue) | Manage state of elements in FIFO-like strategy |
| [use-scroll](./src/use-scroll) | Tracks scroll position of an element |
| [use-singleton](./src/use-singleton) | Creates a value exactly once |
| [use-window-scroll](./src/use-window-scroll) | Tracks scroll position of the window |
| Hook | Description |
| -------------------------------------------- | ----------------------------------------------- |
| [use-in-viewport](./src/use-in-viewport) | Detects if element is visible in the viewport |
| [use-queue](./src/use-queue) | Manage state of elements in FIFO-like strategy |
| [use-scroll](./src/use-scroll) | Tracks scroll position of an element |
| [use-singleton](./src/use-singleton) | Creates a value exactly once |
| [use-window-scroll](./src/use-window-scroll) | Tracks scroll position of the window |
| [use-local-storage](./src/use-local-storage) | Manages state with localStorage synchronization |

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@changesets/cli": "^2.27.7",
"@testing-library/react": "^16.0.0",
"@total-typescript/tsconfig": "^1.0.4",
"@types/react": "^18.3.3",
"@types/react": "^18.3.4",
"@vitejs/plugin-react": "^4.3.1",
"jsdom": "^24.1.1",
"tsup": "^8.2.4",
Expand Down
Loading

0 comments on commit 3e25e8e

Please sign in to comment.