Skip to content

Commit

Permalink
createStore
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Nov 9, 2024
1 parent ab16acc commit d6c3fd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/store/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { InjectionKey } from "vue";
import {
createStore,
createStore as baseCreateStore,
Store as BaseStore,
useStore as baseUseStore,
} from "./vuex";
Expand Down Expand Up @@ -343,14 +343,14 @@ export const indexStore = createPartialStore<IndexStoreTypes>({
},
});

export function createStoreWrapper({
export function createStore({
proxyStoreDI,
}: {
proxyStoreDI?: typeof proxyStore;
}) {
const _proxyStore = proxyStoreDI ?? proxyStore;

return createStore<State, AllGetters, AllActions, AllMutations>({
return baseCreateStore<State, AllGetters, AllActions, AllMutations>({
state: {
...uiStoreState,
...audioStoreState,
Expand Down Expand Up @@ -422,7 +422,7 @@ export function createStoreWrapper({
strict: !isProduction,
});
}
export const store = createStoreWrapper({});
export const store = createStore({});

export const useStore = (): Store => {
return baseUseStore(storeKey);
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/store/audio.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { initializeStateAsSoftwareStarted, mockSandbox } from "./utils";

import { createStoreWrapper } from "@/store";
import { createStore } from "@/store";
import { resetMockMode } from "@/helpers/random";
import { cloneWithUnwrapProxy } from "@/helpers/cloneWithUnwrapProxy";
import { proxyStoreCreator } from "@/store/proxy";
import { UnreachableError } from "@/type/utility";
import { OpenAPIMockEngineConnectorFactory } from "@/infrastructures/EngineConnector";

const store = createStoreWrapper({
const store = createStore({
proxyStoreDI: proxyStoreCreator(OpenAPIMockEngineConnectorFactory),
});
const initialState = cloneWithUnwrapProxy(store.state);
Expand Down

0 comments on commit d6c3fd0

Please sign in to comment.