# @jjordy/use-window-state

> Hook to sync the url and complex state.

Latest version **0.0.4** (published 2022-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jjordy/use-window-state
pnpm add @jjordy/use-window-state
yarn add @jjordy/use-window-state
bun add @jjordy/use-window-state
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2022-12-16 |
| First published | 2022-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 45.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jordan Addison |
| Maintainers | jjordy |
| Keywords | SWR, Devtools, Devtool |

## Links

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

## Dependencies (1)

- [qs](https://npm.io/package/qs.md) ^6.11.0

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2022-12-16
- 0.0.3 — 2022-12-16
- 0.0.2 — 2022-12-16
- 0.0.1 — 2022-12-16

## README

# useWindowState

Keep your url in sync with any arbitrary state thats serializable

## Table of Contents

* [Screenshot](#Screenshot)
* [Live Demo](#live-demo)
  * [CodeSandbox](#codesandbox)
* [Install](#install)
* [Usage](#usage)
* [Props](#props)
* [Maintainers](#maintainers)
* [License](#license)

## Live Demo
[![Edit useWindowState (forked)](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/usewindowstate-7fkowk)


## Install

#### NPM

```bash
npm install @jjordy/use-window-state
```

#### Yarn

```bash
yarn add @jjordy/use-window-state
```

#### Usage

```typescript
import useWindowSize from "@jjordy/use-window-size";

type MyUrlState = {
  limit: number;
  offset: number;
  query: string;
}

export default function App({ Component, pageProps }) {
  const { state, update } = useWindowSize<MyUrlState>({ initialValues: { limit: 0, offset: 0, query: ''}})
  return (
    <div>
      <Pagination limit={state.limit} offset={state.offset} />
    </div>
  );
}
```

#### Props 


| Name  | Type  | Required  | Default |
|---|---|---|---| 
| initialState | `any`  |  no |
| options | `qs options overrides` | no | {} |

## Maintainers

* Jordan Addison

## License

The MIT License (MIT)

Copyright (c) 2021 Jordan Addison

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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