-
Notifications
You must be signed in to change notification settings - Fork 54
feat: create reusable hooks and add sql hook to sdk #376
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
Changes from all commits
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,15 @@ | ||
--- | ||
"@dojoengine/sdk": patch | ||
"@dojoengine/core": patch | ||
"@dojoengine/create-burner": patch | ||
"@dojoengine/create-dojo": patch | ||
"@dojoengine/predeployed-connector": patch | ||
"@dojoengine/react": patch | ||
"@dojoengine/state": patch | ||
"@dojoengine/torii-client": patch | ||
"@dojoengine/torii-wasm": patch | ||
"@dojoengine/utils": patch | ||
"@dojoengine/utils-wasm": patch | ||
--- | ||
|
||
Add @dojoengine/sdk/state @dojoengine/sdk/react @dojoengine/sdk/sql // Moves hooks to sdk // Update examples |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { ParsedEntity, SDK } from "@dojoengine/sdk"; | ||
import { ParsedEntity } from "@dojoengine/sdk"; | ||
import { useAccount } from "@starknet-react/core"; | ||
import { SchemaType } from "./typescript/models.gen"; | ||
import { AccountInterface, addAddressPadding } from "starknet"; | ||
import { useEffect, useState } from "react"; | ||
import { Subscription } from "@dojoengine/torii-client"; | ||
import { useDojoSDK } from "@dojoengine/sdk/react"; | ||
|
||
export function HistoricalEvents({ sdk }: { sdk: SDK<SchemaType> }) { | ||
export function HistoricalEvents() { | ||
const { account } = useAccount(); | ||
const { sdk } = useDojoSDK(); | ||
const [events, setEvents] = useState<ParsedEntity<SchemaType>[][]>([]); | ||
const [subscription, setSubscription] = useState<Subscription | null>(null); | ||
|
||
Comment on lines
+9
to
13
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 Fix needed for TypeScript type issue in historical-events.tsx The 🔗 Analysis chainConsider addressing the TypeScript type issue. The code includes a Let's check if there are similar type issues elsewhere in the codebase: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for ts-expect-error comments related to types
rg "@ts-expect-error" -A 2
Length of output: 6894 |
||
|
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
Add error boundary for SDK initialization.
The SDK usage should be wrapped in proper error handling to gracefully handle initialization failures.
📝 Committable suggestion