From c826e64d155401f729c48c332708a4a1ed95d662 Mon Sep 17 00:00:00 2001 From: jan Date: Fri, 20 Nov 2020 23:44:36 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[store]=20fix=20v3=20"e=20is=20u?= =?UTF-8?q?ndefined"=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/store.ts b/src/store.ts index 1c2bdd8497..eeaa095603 100644 --- a/src/store.ts +++ b/src/store.ts @@ -193,20 +193,20 @@ export default (Vue: VueConstructor): Store => { // @ts-ignore trueBase[trueEvent] = (...args: unknown[]) => { document.dispatchEvent( - new CustomEvent(`lssm_${event}_before`, { + new CustomEvent(`${PREFIX}_${event}_before`, { detail: args, }) ); state.hooks[event](...args); document.dispatchEvent( - new CustomEvent(`lssm_${event}_after`, { + new CustomEvent(`${PREFIX}_${event}_after`, { detail: args, }) ); }; } document.addEventListener( - `lssm_${event}_${post ? 'after' : 'before'}`, + `${PREFIX}_${event}_${post ? 'after' : 'before'}`, event => callback(...((event as unknown) as LSSMEvent).detail) ); @@ -241,7 +241,7 @@ export default (Vue: VueConstructor): Store => { // @ts-ignore trueBase.__proto__[event] = (...args: unknown[]) => { document.dispatchEvent( - new CustomEvent(`lssm_${eventString}_before`, { + new CustomEvent(`${PREFIX}_${eventString}_before`, { detail: args, }) ); @@ -250,14 +250,14 @@ export default (Vue: VueConstructor): Store => { ...args ); document.dispatchEvent( - new CustomEvent(`lssm_${eventString}_after`, { + new CustomEvent(`${PREFIX}_${eventString}_after`, { detail: args, }) ); }; } document.addEventListener( - `lssm_${eventString}_${post ? 'after' : 'before'}`, + `${PREFIX}_${eventString}_${post ? 'after' : 'before'}`, event => callback(...((event as unknown) as LSSMEvent).detail) );