state-in-url 4.1.3 → 4.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +13 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -22,6 +22,7 @@ English | [한국어](./README.KO.md) | [简体中文](./README.CN.md)
22
22
 
23
23
  [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/asmyshlyaev177/state-in-url/badge)](https://scorecard.dev/viewer/?uri=github.com/asmyshlyaev177/state-in-url)
24
24
  [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9679/badge)](https://www.bestpractices.dev/projects/9679)
25
+ [![license](https://img.shields.io/github/license/asmyshlyaev177/state-in-url.svg?style=flat-square)](https://github.com/asmyshlyaev177/state-in-url/blob/master/LICENSE)
25
26
  <!-- or by embedding this in your HTML:
26
27
  <a href="https://www.bestpractices.dev/projects/9679"><img src="https://www.bestpractices.dev/projects/9679/badge"></a> -->
27
28
 
@@ -33,8 +34,10 @@ English | [한국어](./README.KO.md) | [简体中文](./README.CN.md)
33
34
 
34
35
  ![Demo-gif](https://github.com/asmyshlyaev177/state-in-url/blob/master/assets/Demo-gif.gif)
35
36
 
36
- <a href="https://state-in-url.dev" target="_blank">DEMO</a> |
37
- <a href="https://state-in-url.netlify.app/" target="_blank">DEMO2</a>
37
+ # Demo
38
+
39
+ <a href="https://state-in-url.dev" target="_blank">Demo</a> |
40
+ <a href="https://state-in-url.netlify.app/" target="_blank">Mirror link</a>
38
41
 
39
42
  <a href="https://github.com/asmyshlyaev177/state-in-url/blob/master/Limits.md" target="_blank">URI size limitation, <b>up to 12KB</b> is safe</a>
40
43
 
@@ -592,7 +595,14 @@ const userState = {
592
595
  };
593
596
 
594
597
  export const useUserState = () => {
595
- const { urlState, setUrl } = useUrlState(userState);
598
+ const { urlState, setUrl, reset } = useUrlState(userState);
599
+
600
+ // other logic
601
+
602
+ // reset query params when navigating to other page
603
+ React.useEffect(() => {
604
+ return reset
605
+ }, [])
596
606
 
597
607
  return { userState: urlState, setUserState: setUrl };;
598
608
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "state-in-url",
3
- "version": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "description": "Easily share complex state objects between unrelated React components, preserve types and structure, with TS validation. Deep links and url state synchronization wthout any hasssle or boilerplate.",
5
5
  "homepage": "https://state-in-url.dev",
6
6
  "repository": {