direct-vuex
Advanced tools
Comparing version 0.7.5 to 0.7.6
@@ -94,3 +94,4 @@ "use strict"; | ||
context = createModuleActionContext(options, originalContext, store); | ||
actionContexts.set(originalContext.dispatch, context); | ||
if (originalContext.dispatch) // Can be 'undefined' in test units | ||
actionContexts.set(originalContext.dispatch, context); | ||
} | ||
@@ -120,3 +121,4 @@ return context; | ||
context = createRootActionContext(originalContext, store); | ||
actionContexts.set(originalContext.dispatch, context); | ||
if (originalContext.dispatch) // Can be 'undefined' in test units | ||
actionContexts.set(originalContext.dispatch, context); | ||
} | ||
@@ -123,0 +125,0 @@ return context; |
{ | ||
"name": "direct-vuex", | ||
"version": "0.7.5", | ||
"version": "0.7.6", | ||
"description": "Use and implement your Vuex store with TypeScript types. Compatible with the Vue 3 composition API.", | ||
@@ -5,0 +5,0 @@ "author": "Paleo", |
@@ -113,3 +113,3 @@ # direct-vuex | ||
actions: { | ||
async myAction(context, payload) { | ||
async myAction(context: any, payload) { | ||
const { commit, state } = myModuleActionContext(context) | ||
@@ -121,3 +121,3 @@ // … Here, 'commit' and 'state' are typed. | ||
export default myModule | ||
export const myModuleActionContext = context => moduleActionContext(context, myModule) | ||
export const myModuleActionContext = (context: any) => moduleActionContext(context, myModule) | ||
``` | ||
@@ -129,3 +129,3 @@ | ||
actions: { | ||
async myAction(context, payload) { | ||
async myAction(context: any, payload) { | ||
const { commit, state } = rootActionContext(context) | ||
@@ -132,0 +132,0 @@ // … Here, 'commit' and 'state' are typed. |
@@ -141,3 +141,4 @@ import Vuex, { ActionContext, Store } from "vuex" | ||
context = createModuleActionContext(options, originalContext, store) | ||
actionContexts.set(originalContext.dispatch, context) | ||
if (originalContext.dispatch) // Can be 'undefined' in test units | ||
actionContexts.set(originalContext.dispatch, context) | ||
} | ||
@@ -173,3 +174,4 @@ return context | ||
context = createRootActionContext(originalContext, store) | ||
actionContexts.set(originalContext.dispatch, context) | ||
if (originalContext.dispatch) // Can be 'undefined' in test units | ||
actionContexts.set(originalContext.dispatch, context) | ||
} | ||
@@ -176,0 +178,0 @@ return context |
37069
759