Skip to content

Commit

Permalink
fix(create-mud): update zustand usage in phaser template (#1365)
Browse files Browse the repository at this point in the history
  • Loading branch information
aLIEzsss4 authored Sep 1, 2023
1 parent b77b1a4 commit bbe4def
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions templates/phaser/packages/client/src/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createStore } from "zustand/vanilla";
import createReactStore from "zustand";
import { create } from "zustand";
import { NetworkLayer } from "./layers/network/createNetworkLayer";
import { PhaserLayer } from "./layers/phaser/createPhaserLayer";

Expand All @@ -15,14 +14,12 @@ export type UIStore = {
devMode: boolean;
};

export const store = createStore<Store>(() => ({
export const useStore = create<Store>(() => ({
networkLayer: null,
phaserLayer: null,
devMode: false,
}));

export const useStore = createReactStore(store);

export const useMUD = () => {
const { networkLayer, phaserLayer, devMode } = useStore();

Expand Down

0 comments on commit bbe4def

Please sign in to comment.