Skip to content

Commit

Permalink
docs: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Jan 23, 2025
1 parent af38e91 commit 1fa3c4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/src/pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
"title": "Utilities"
},
"context-state": {},
"context-local-storage-state": {},
"context-session-storage-state": {},
"create-local-storage-state": {},
"create-session-storage-state": {},
"create-fixed-array": {},
"fetch-jsonp": {},
"invariant-nullthrow": {},
Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/create-session-storage-state.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import ExportMetaInfo from '../components/export-meta-info';

<ExportMetaInfo />

Store your shared state that lives in sessionStorage and synchronize the state of a component with the data stored in the `localStorage`. Lift your state up and passing them deeply into your React app without worrying about performance.
Store your shared state that lives in sessionStorage and synchronize the state of a component with the data stored in the `sessionStorage`. Lift your state up and passing them deeply into your React app without worrying about performance.

## Usage

```tsx filename="src/context/sidebar-active.tsx" copy
import { createSessionStorageState } from 'foxact/create-session-storage-state';

const [useSidebarActive, useSidebarActiveValue] = createSessionStorageState(
'sidebar-active', // The localStorage key
'sidebar-active', // The sessionStorage key
/**
* The initial value to use if there is no item in the local storage with the provided key,
* the undefined value will be used if no initial value is provided.
Expand All @@ -28,7 +28,7 @@ const [useSidebarActive, useSidebarActiveValue] = createSessionStorageState(
* Optional configuration object enables the customization of value serialization before it's stored in local storage.
*/
{
// Optional, default to false. When set to "true", the value will be passed to the localStorage API as is.
// Optional, default to false. When set to "true", the value will be passed to the sessionStorage API as is.
raw: false,
// Optional, default to "JSON.stringify". Can only be specified when the "raw" is set to false (which is the default).
serializer: JSON.stringify,
Expand Down

0 comments on commit 1fa3c4b

Please sign in to comment.