@unsetsoft/ryunixjs 0.4.13-nightly.49 → 0.4.13-nightly.50

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.
package/dist/Ryunix.js CHANGED
@@ -282,10 +282,16 @@
282
282
  setCurrentPath(() => window.location.pathname);
283
283
  };
284
284
 
285
+ window.addEventListener('navigate', onLocationChange);
286
+ window.addEventListener('pushsatate', onLocationChange);
285
287
  window.addEventListener('popstate', onLocationChange);
286
288
 
287
289
  return () => {
288
- window.removeEventListener('popstate', onLocationChange);
290
+ setTimeout(() => {
291
+ window.removeEventListener('navigate', onLocationChange);
292
+ window.removeEventListener('pushsatate', onLocationChange);
293
+ window.removeEventListener('popstate', onLocationChange);
294
+ }, 100);
289
295
  }
290
296
  }, [currentPath]);
291
297
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsetsoft/ryunixjs",
3
- "version": "0.4.13-nightly.49",
3
+ "version": "0.4.13-nightly.50",
4
4
  "license": "MIT",
5
5
  "main": "./dist/Ryunix.js",
6
6
  "types": "./dist/Ryunix.d.ts",
@@ -8,10 +8,16 @@ const Router = ({ path, component, children }) => {
8
8
  setCurrentPath(() => window.location.pathname)
9
9
  }
10
10
 
11
+ window.addEventListener('navigate', onLocationChange)
12
+ window.addEventListener('pushsatate', onLocationChange)
11
13
  window.addEventListener('popstate', onLocationChange)
12
14
 
13
15
  return () => {
14
- window.removeEventListener('popstate', onLocationChange)
16
+ setTimeout(() => {
17
+ window.removeEventListener('navigate', onLocationChange)
18
+ window.removeEventListener('pushsatate', onLocationChange)
19
+ window.removeEventListener('popstate', onLocationChange)
20
+ }, 100)
15
21
  }
16
22
  }, [currentPath])
17
23