Skip to content

Commit

Permalink
fix: change store context interface name
Browse files Browse the repository at this point in the history
  • Loading branch information
gsi-chao committed Mar 13, 2021
1 parent 51446a7 commit c174437
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { createStore, Store } from "./fluvx";
export { VStoreProps, ActionContext } from "./types";
export { VStoreProps, StoreContext } from "./types";
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface VStoreProps<T extends object> {
actions?: Record<string, Function>;
}

export interface ActionContext<T extends object> {
export interface StoreContext<T extends object> {
state: T;
commit: (type: string, payload?: unknown) => Promise<unknown>;
dispatch: (type: string, payload?: unknown) => void;
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/fluvx/state.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createStore, ActionContext } from "@/index";
import { createStore, StoreContext } from "@/index";

interface OurState {
count: number;
Expand Down Expand Up @@ -69,7 +69,7 @@ describe("test state of store", () => {
}
},
actions: {
increment({ commit }: ActionContext<OurState>, payload: unknown) {
increment({ commit }: StoreContext<OurState>, payload: unknown) {
commit("increment", payload);
}
}
Expand Down

0 comments on commit c174437

Please sign in to comment.