Gathering detailed insights and metrics for @jjordy/use-window-state
Gathering detailed insights and metrics for @jjordy/use-window-state
A hook that allows you to sync & update the url with complex state
npm install @jjordy/use-window-state
Typescript
Module System
Node Version
NPM Version
TypeScript (87.92%)
JavaScript (12.08%)
Total Downloads
600
Last Day
3
Last Week
6
Last Month
24
Last Year
120
7 Commits
1 Watching
2 Branches
1 Contributors
Latest Version
0.0.4
Package Id
@jjordy/use-window-state@0.0.4
Unpacked Size
45.30 kB
Size
14.13 kB
File Count
10
NPM Version
8.11.0
Node Version
16.15.1
Cumulative downloads
Total Downloads
Last day
200%
3
Compared to previous day
Last week
-33.3%
6
Compared to previous week
Last month
380%
24
Compared to previous month
Last year
-40%
120
Compared to previous year
1
Keep your url in sync with any arbitrary state thats serializable
1npm install @jjordy/use-window-state
1yarn add @jjordy/use-window-state
1import useWindowSize from "@jjordy/use-window-size"; 2 3type MyUrlState = { 4 limit: number; 5 offset: number; 6 query: string; 7} 8 9export default function App({ Component, pageProps }) { 10 const { state, update } = useWindowSize<MyUrlState>({ initialValues: { limit: 0, offset: 0, query: ''}}) 11 return ( 12 <div> 13 <Pagination limit={state.limit} offset={state.offset} /> 14 </div> 15 ); 16}
Name | Type | Required | Default |
---|---|---|---|
initialState | any | no | |
options | qs options overrides | no | {} |
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.
No vulnerabilities found.
No security vulnerabilities found.