Skip to content

Commit

Permalink
fix dev log
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWangJustToDo committed Feb 19, 2024
1 parent 3e80962 commit 341573b
Show file tree
Hide file tree
Showing 5 changed files with 240 additions and 452 deletions.
4 changes: 4 additions & 0 deletions app/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ export default defineConfig({

socialLinks: [{ icon: "github", link: "https://github.com/MrWangJustToDo/r-store" }],
},
head: [
["link", { rel: "preconnect", href: "https://fonts.cdnfonts.com/", crossorigin: "" }],
["link", { rel: "stylesheet", href: "https://fonts.cdnfonts.com/css/google-sans" }],
],
});
2 changes: 1 addition & 1 deletion app/.vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/* font-family */
:root {
--vp-font-family-base: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif,
--vp-font-family-base: Product Sans, sans-serif, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif,
Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
}

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"@swc/core": "^1.3.100",
"@types/lodash": "^4.14.202",
"@types/node": "^20.10.4",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.17",
"@types/react": "^18.2.56",
"@types/react-dom": "^18.2.19",
"eslint": "^8.55.0",
"husky": "^8.0.2",
"lodash": "^4.17.21",
Expand All @@ -47,7 +47,7 @@
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"typescript": "^5.3.3",
"vitepress": "1.0.0-rc.31",
"vitepress": "1.0.0-rc.43",
"vue": "^3.3.11"
}
}
17 changes: 11 additions & 6 deletions packages/r-store/src/shared/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ export const checkHasKey = (key: string) => {

if (__DEV__ && !isServer) {
try {
// if (globalThis["@reactivity-store"]) {
// console.error(`[reactivity-store] you are using multiple version of reactivity-store, this is a unexpected usage`);
// }
globalThis["@reactivity-store"] = new WeakMap();
globalThis["@reactivity-store"] = globalThis["@reactivity-store"] || new WeakMap();
} catch {
void 0;
}
Expand Down Expand Up @@ -115,10 +112,18 @@ export const connectDevTool = (name: string, actions: Record<string, Function>,

if (isPromise(re)) {
re.finally(() => {
sendToDevTools({type: `asyncAction-${name}/${action.name || 'anonymous'}`, $payload: args.slice(0, len), getUpdatedState: () => ({ ...devToolMap, [name]: JSON.parse(JSON.stringify(state)) })});
sendToDevTools({
type: `asyncAction-${name}/${action.name || "anonymous"}`,
$payload: args.slice(0, len),
getUpdatedState: () => ({ ...devToolMap, [name]: JSON.parse(JSON.stringify(state)) }),
});
});
} else {
sendToDevTools({type: `syncAction-${name}/${action.name || 'anonymous'}`, $payload: args.slice(0, len), getUpdatedState: () => ({ ...devToolMap, [name]: JSON.parse(JSON.stringify(state)) })});
sendToDevTools({
type: `syncAction-${name}/${action.name || "anonymous"}`,
$payload: args.slice(0, len),
getUpdatedState: () => ({ ...devToolMap, [name]: JSON.parse(JSON.stringify(state)) }),
});
}
return re;
};
Expand Down
Loading

0 comments on commit 341573b

Please sign in to comment.