-
Notifications
You must be signed in to change notification settings - Fork 54
feat: new readme #286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: new readme #286
Changes from all commits
9cbee9f
872235c
bf258d4
970e9bd
e6076f0
6e69883
2f3d287
51039e4
40eb5cd
9c2e4dd
509f5e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useDojoStore } from "./App"; | ||
import { Schema } from "./bindings"; | ||
|
||
/** | ||
* Custom hook to retrieve a specific model for a given entityId within a specified namespace. | ||
* | ||
* @param entityId - The ID of the entity. | ||
* @param model - The model to retrieve, specified as a string in the format "namespace-modelName". | ||
* @returns The model structure if found, otherwise undefined. | ||
*/ | ||
function useModel<N extends keyof Schema, M extends keyof Schema[N] & string>( | ||
entityId: string, | ||
model: `${N}-${M}` | ||
): Schema[N][M] | undefined { | ||
const [namespace, modelName] = model.split("-") as [N, M]; | ||
|
||
// Select only the specific model data for the given entityId | ||
const modelData = useDojoStore( | ||
(state) => | ||
state.entities[entityId]?.models?.[namespace]?.[modelName] as | ||
| Schema[N][M] | ||
| undefined | ||
); | ||
|
||
return modelData; | ||
} | ||
|
||
export default useModel; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,19 +10,16 @@ | |
"docs": "npx typedoc --out docs", | ||
"prepare": "husky install" | ||
}, | ||
"dependencies": { | ||
"@commitlint/cli": "^18.4.4", | ||
"@commitlint/config-conventional": "^18.4.4", | ||
"@ianvs/prettier-plugin-sort-imports": "^4.3.1", | ||
"react": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"husky": "^9.0.11", | ||
"husky": "^9.1.6", | ||
"lerna": "^8.1.5", | ||
"prettier": "^3.3.3", | ||
"tsup": "^8.1.0", | ||
"typedoc": "^0.26.7", | ||
"typedoc-material-theme": "^1.1.0", | ||
"typedoc-plugin-coverage": "^3.3.0" | ||
"typedoc-plugin-coverage": "^3.3.0", | ||
"@commitlint/cli": "^18.4.4", | ||
"@commitlint/config-conventional": "^18.4.4", | ||
"@ianvs/prettier-plugin-sort-imports": "^4.3.1" | ||
Comment on lines
+14
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification React is still in use within the project The Please address the following:
🔗 Analysis chainVerify the removal of React dependency The Please confirm if this removal was intentional. If it was:
If this removal was unintentional, please add React back to the appropriate section ( To help verify the usage of React in the project, you can run the following script: This script will help identify if React is still being used in the project, which can guide the decision on whether to keep or remove the React dependency. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for React usage in the project
# Search for React imports or usage in JavaScript and TypeScript files
echo "Searching for React usage:"
rg --type js --type ts 'import.*React|from.*react|React\.' -g '!node_modules'
# Check if there are any JSX files in the project
echo -e "\nChecking for JSX files:"
fd -e jsx -e tsx
Length of output: 28503 |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { BurnerManager } from "./burnerManager"; | ||
export { PredeployedManager } from "./predeployedManager"; | ||
export { prefundAccount } from "./prefundAccount"; | ||
export { setupBurnerManager } from "./setupBurnerManager"; |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Refactor burner manager setup to improve code structure.
While the direct integration of
setupBurnerManager
into the component props simplifies the code, usingawait
inside JSX is not recommended and may lead to unexpected behavior.Consider refactoring this part to separate the asynchronous operation from the JSX:
This change will improve code readability and prevent potential issues with using
await
in JSX.📝 Committable suggestion