Skip to content

Commit 61fcea0

Browse files
committed
linting/whitespace
1 parent 64cefdc commit 61fcea0

57 files changed

Lines changed: 8712 additions & 8767 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
1+
import { queryTorii } from "@dojoengine/sdk/sql";
12
import type { App, AppStore } from "@pixelaw/core";
23
import type { DojoStuff } from "./DojoEngine.init.ts";
3-
import { queryTorii } from "@dojoengine/sdk/sql";
44
import { convertFullHexString } from "./utils/utils.ts";
55

66
type State = { [key: string]: App | undefined };
77

88
export class DojoAppStore implements AppStore {
9-
private dojoStuff;
10-
private state: State = {};
11-
12-
constructor(dojoStuff: DojoStuff) {
13-
this.dojoStuff = dojoStuff;
14-
}
15-
16-
public static async getInstance(dojoStuff: DojoStuff): Promise<DojoAppStore> {
17-
const dojoAppStore = new DojoAppStore(dojoStuff);
18-
19-
await dojoAppStore.initialize();
20-
// await dojoAppStore.subscribe()
21-
return dojoAppStore;
22-
}
23-
24-
private async initialize() {
25-
try {
26-
const items = await queryTorii(
27-
this.dojoStuff.toriiUrl,
28-
`SELECT *
9+
private dojoStuff;
10+
private state: State = {};
11+
12+
constructor(dojoStuff: DojoStuff) {
13+
this.dojoStuff = dojoStuff;
14+
}
15+
16+
public static async getInstance(dojoStuff: DojoStuff): Promise<DojoAppStore> {
17+
const dojoAppStore = new DojoAppStore(dojoStuff);
18+
19+
await dojoAppStore.initialize();
20+
// await dojoAppStore.subscribe()
21+
return dojoAppStore;
22+
}
23+
24+
private async initialize() {
25+
try {
26+
const items = await queryTorii(
27+
this.dojoStuff.toriiUrl,
28+
`SELECT *
2929
FROM "pixelaw-App";`,
30-
(rows: any[]) => {
31-
return rows;
32-
},
33-
);
34-
for (const item of items) {
35-
const app: App = {
36-
action: convertFullHexString(item.action),
37-
icon: convertFullHexString(item.icon),
38-
name: convertFullHexString(item.name),
39-
plugin: item.plugin,
40-
system: item.system,
41-
entity: { id: "" }, // TODO
42-
};
43-
this.state[app.name] = app;
44-
console.log("APP", app);
45-
}
46-
// console.log({ items })
47-
} catch (e) {
48-
console.error(e);
49-
}
50-
}
51-
52-
getAll(): App[] {
53-
return Object.values(this.state);
54-
}
55-
56-
getByName(name: string): App | undefined {
57-
return this.state[name];
58-
}
59-
60-
getBySystem(system: string): App | undefined {
61-
return Object.values(this.state).find((app) => app?.system === system);
62-
}
30+
(rows: any[]) => {
31+
return rows;
32+
},
33+
);
34+
for (const item of items) {
35+
const app: App = {
36+
action: convertFullHexString(item.action),
37+
icon: convertFullHexString(item.icon),
38+
name: convertFullHexString(item.name),
39+
plugin: item.plugin,
40+
system: item.system,
41+
entity: { id: "" }, // TODO
42+
};
43+
this.state[app.name] = app;
44+
console.log("APP", app);
45+
}
46+
// console.log({ items })
47+
} catch (e) {
48+
console.error(e);
49+
}
50+
}
51+
52+
getAll(): App[] {
53+
return Object.values(this.state);
54+
}
55+
56+
getByName(name: string): App | undefined {
57+
return this.state[name];
58+
}
59+
60+
getBySystem(system: string): App | undefined {
61+
return Object.values(this.state).find((app) => app?.system === system);
62+
}
6363
}

0 commit comments

Comments
 (0)