# @sailnjord/use-search-state

Latest version **0.0.3** (published 2022-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sailnjord/use-search-state
pnpm add @sailnjord/use-search-state
yarn add @sailnjord/use-search-state
bun add @sailnjord/use-search-state
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2022-02-24 |
| First published | 2022-02-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jonas Witt |
| Maintainers | jonaswitt |

## Links

- npm: https://www.npmjs.com/package/@sailnjord/use-search-state
- Repository: https://github.com/sailnjord/use-search-state
- Homepage: https://github.com/sailnjord/use-search-state#readme
- Issues: https://github.com/sailnjord/use-search-state/issues
- npm.io page: https://npm.io/package/@sailnjord/use-search-state

## Recent versions

- 0.0.3 (latest) — 2022-02-24
- 0.0.2 — 2022-02-17
- 0.0.1 — 2022-02-11

## README

# use-search-state

<p>
    <a aria-label="NPM version" href="https://www.npmjs.com/package/@sailnjord/use-search-state">
    <img alt="" src="https://badgen.net/npm/v/@sailnjord/use-search-state">
  </a>
  <a aria-label="Package size" href="https://bundlephobia.com/result?p=@sailnjord/use-search-state">
    <img alt="" src="https://badgen.net/bundlephobia/minzip/@sailnjord/use-search-state">
  </a>
  <a aria-label="License" href="https://github.com/@sailnjord/use-search-state/blob/main/LICENSE">
    <img alt="" src="https://badgen.net/npm/license/@sailnjord/use-search-state">
  </a>
</p>

## Usage

```typescript
useSearchState(
  // Send any state to the search/query string
  // Changing this value will cause a pushState()
  {
    foo: 123,
    bar: 42,
  },
  // Handle changes in the search/query string
  // (called once for the initial page load, and for
  // subsequent changes including on forward/back
  // navigation by the user)
  ({ foo, bar }) => {
    // For example, copy to local state:
    // setFoo(foo)
    // setBar(bar)
  }
);
```

---
_Source: https://npm.io/package/@sailnjord/use-search-state · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
