Skip to content

Commit

Permalink
✅ Passes test
Browse files Browse the repository at this point in the history
  • Loading branch information
ekwoka committed Nov 29, 2023
1 parent 5285bce commit 2bf8b97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions packages/params/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ export const query: PluginCallback = (Alpine) => {
});

onURLChange((url) => {
console.log('url changed', url.search);
const query = fromQueryString(url.search);
updateParams(query);
});
Expand Down Expand Up @@ -176,7 +175,6 @@ const paramEffect = (
return () => {
const current = JSON.stringify(params[key]);
if (current === previous) return;
console.log('param changed', current);
untrack(() => setParams(params, method));
previous = current;
};
Expand Down Expand Up @@ -306,7 +304,7 @@ if (import.meta.vitest) {
await Alpine.nextTick();
expect(data).toEqual({ foo: 'bar' });
expect(paramObject).toEqual({});
expect(history.replaceState).toHaveBeenCalledWith({ query: {} }, '', '?');
expect(history.replaceState).toHaveBeenCalledWith({ query: {} }, '', '/');
});
it('can always show the initial value', async () => {
vi.spyOn(history, UpdateMethod.replace);
Expand Down
8 changes: 4 additions & 4 deletions size.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"params": {
"minified": {
"pretty": "2.25 kB",
"raw": 2245
"pretty": "2.18 kB",
"raw": 2178
},
"brotli": {
"pretty": "1.05 kB",
"raw": 1052
"pretty": "1.03 kB",
"raw": 1029
}
},
"xajax": {
Expand Down

0 comments on commit 2bf8b97

Please sign in to comment.