-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from jaredmcateer/vuex-class
- Loading branch information
Showing
18 changed files
with
894 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { convertVuexMethodFactory } from "./convertMethodFactory"; | ||
|
||
/** | ||
* @example | ||
* \@Action('myNamespace/someAction') doSomeAction: (text: string) => Promise<void> | ||
* // converts to | ||
* const doSomeAction = async (text: string): Promise<void> => { | ||
* return await store.dispatch('myNamespace/someAction', text); | ||
* } | ||
* @param node | ||
* @param options | ||
* @returns | ||
*/ | ||
export const convertVuexAction = convertVuexMethodFactory("Action", "dispatch"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { convertVuexComputedFactory } from "./convertComputedFactory"; | ||
|
||
/** | ||
* @example | ||
* \@Getter('myNamespace/someGetter') getSomething: boolean; | ||
* // converts to | ||
* const getSomething = computed<boolean>(() => { | ||
* return store.getter('myNamespace/someGetter'); | ||
* }) | ||
*/ | ||
export const convertVuexGetter = convertVuexComputedFactory("Getter", "getters"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { convertVuexMethodFactory } from "./convertMethodFactory"; | ||
|
||
/** | ||
* @example | ||
* \@Mutation('myNamespace/SOME_MUTATION') mutateSomething: (text: string) => void | ||
* // converts to | ||
* const mutateSomething = (text: string): void => { | ||
* return store.commit('myNamespace/SOME_MUTATION', text); | ||
* } | ||
* @param node | ||
* @param options | ||
* @returns | ||
*/ | ||
export const convertVuexMutation = convertVuexMethodFactory("Mutation", "commit"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { convertVuexComputedFactory } from "./convertComputedFactory"; | ||
|
||
/** | ||
* @example | ||
* \@State('myNamespace/stateA') sA: number; | ||
* // converts to | ||
* const sA = computed(() => { | ||
* return store.state.stateA; | ||
* }); | ||
*/ | ||
export const convertVuexState = convertVuexComputedFactory("State", "state"); |
Oops, something went wrong.