cdui-js 1.0.21 → 1.0.22

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/package.json +1 -1
  2. package/src/location.ts +7 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdui-js",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "bin": {
package/src/location.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { isBrowser } from './dom';
2
- import { reactive } from './reactive';
2
+ import { batch, reactive } from './reactive';
3
3
 
4
4
  export interface Location {
5
5
  /**
@@ -98,10 +98,12 @@ export const updateURL = (path: string, search?: string, hash?: string) => {
98
98
  location.hash = hash || '';
99
99
 
100
100
  if (location.path !== path || location.search !== search) {
101
- location.path = path;
102
- location.paths = path.match(/\/[^/]*/g) || [];
103
- location.search = search || '';
104
- location.query = search ? parseQuery(search) : {};
101
+ batch(() => {
102
+ location.path = path;
103
+ location.paths = path.match(/\/[^/]*/g) || [];
104
+ location.search = search || '';
105
+ location.query = search ? parseQuery(search) : {};
106
+ });
105
107
  }
106
108
  };
107
109