Skip to content

Commit d0ae3fb

Browse files
feat: impl composite clause for subs
1 parent 0d279f9 commit d0ae3fb

File tree

9 files changed

+38
-2119
lines changed

9 files changed

+38
-2119
lines changed

examples/dojo-starter

Submodule dojo-starter updated 29 files

examples/react/react-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "tsc && vite build",
99
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
1010
"preview": "vite preview",
11-
"create-components": "npx /Users/os/Documents/code/dojo/dojo.js/packages/core/bin/generateComponents.cjs /Users/os/Documents/code/dojo/dojo.js/examples/dojo-starter/manifests/dev/deployment/manifest.json src/dojo/generated/contractComponents.ts http://0.0.0.0:5050 0x16a15cc2a571bf95eef741c701a5657e4dbf1a5b9ce3785b4060b60f58913f4"
11+
"create-components": "npx @dojoengine/core ../../dojo-starter/manifests/dev/manifest.json src/dojo/generated/contractComponents.ts http://localhost:5050 0xb4079627ebab1cd3cf9fd075dda1ad2454a7a448bf659591f259efa2519b18"
1212
},
1313
"dependencies": {
1414
"@dojoengine/core": "workspace:*",

examples/react/react-app/src/App.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import {
2-
useComponentValue,
3-
useEntityQuery,
4-
useQuerySync,
5-
} from "@dojoengine/react";
6-
import { Entity, HasValue } from "@dojoengine/recs";
7-
import { useEffect, useState } from "react";
81
import "./App.css";
2+
import { useComponentValue, useQuerySync } from "@dojoengine/react";
3+
import { Entity } from "@dojoengine/recs";
4+
import { useEffect, useState } from "react";
95
import { Direction } from "./utils";
106
import { getEntityIdFromKeys } from "@dojoengine/utils";
117
import { useDojo } from "./dojo/useDojo";
@@ -21,14 +17,15 @@ function App() {
2117
account,
2218
} = useDojo();
2319

24-
useQuerySync(
25-
toriiClient,
26-
contractComponents as any,
27-
["Moves", "Position", "DirectionsAvailable"],
28-
[account?.account.address.toString()]
29-
);
30-
31-
// get entites = filter by
20+
useQuerySync(toriiClient, contractComponents as any, [
21+
{
22+
Keys: {
23+
keys: [BigInt(account?.account.address).toString()],
24+
models: ["Position", "Moves", "DirectionsAvailable"],
25+
pattern_matching: "FixedLen",
26+
},
27+
},
28+
]);
3229

3330
const [clipboardStatus, setClipboardStatus] = useState({
3431
message: "",

packages/core/src/_test_/config/config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect, vi } from "vitest";
1+
import { describe, it, expect } from "vitest";
22
import { createDojoConfig } from "../../config/index";
33

44
describe("config", () => {

packages/core/src/_test_/utils/utils.test.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)