Skip to content

Commit

Permalink
remove limit
Browse files Browse the repository at this point in the history
  • Loading branch information
LidamaoHub committed Nov 4, 2023
1 parent e4d39db commit 56cf0fc
Showing 1 changed file with 26 additions and 32 deletions.
58 changes: 26 additions & 32 deletions packages/client/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,50 +1,44 @@
import { setup } from "./mud/setup";
import mudConfig from "contracts/mud.config";
import ReactDOM from "react-dom/client";
import { App } from './App';
import './common.scss';
import { world } from '@/mud/world';
import { App } from "./App";
import "./common.scss";
import { world } from "@/mud/world";
import { MUDProvider } from "@/mud/MUDContext";
const {
network,
} = await setup();
const { network } = await setup();

// Components expose a stream that triggers when the component is updated.


const rootElement = document.getElementById("root");
setup().then(async (result) => {
root.render(
<MUDProvider value={result}>
<App/>
<App />
</MUDProvider>
)
);
});
if (!rootElement) throw new Error("React root not found");

const root = ReactDOM.createRoot(rootElement);


// https://vitejs.dev/guide/env-and-mode.html
if (true) {
const { mount: mountDevTools } = await import("@latticexyz/dev-tools");
const comp = [];
network.world.components.forEach((c) => {
if (comp.findIndex((item => item.id === c.id)) === -1) {
comp.push(c);
}
});
network.world.components = comp;
mountDevTools({
config: mudConfig,
publicClient: network.publicClient,
walletClient: network.walletClient,
latestBlock$: network.latestBlock$,
blockStorageOperations$: network.blockStorageOperations$,
worldAddress: network.worldContract.address,
worldAbi: network.worldContract.abi,
write$: network.write$,
recsWorld: network.world,
});
console.log("mounted")
}
const { mount: mountDevTools } = await import("@latticexyz/dev-tools");
const comp = [];
network.world.components.forEach((c) => {
if (comp.findIndex((item) => item.id === c.id) === -1) {
comp.push(c);
}
});
network.world.components = comp;
mountDevTools({
config: mudConfig,
publicClient: network.publicClient,
walletClient: network.walletClient,
latestBlock$: network.latestBlock$,
blockStorageOperations$: network.blockStorageOperations$,
worldAddress: network.worldContract.address,
worldAbi: network.worldContract.abi,
write$: network.write$,
recsWorld: network.world,
});
console.log("mounted");

0 comments on commit 56cf0fc

Please sign in to comment.