From: Eduardo San Martin Morote Date: Wed, 21 Jul 2021 08:41:56 +0000 (+0200) Subject: chore: comments X-Git-Tag: v2.0.0-rc.0~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2776cc25752b6e669aa44f77e2863e5563fe303b;p=thirdparty%2Fvuejs%2Fpinia.git chore: comments --- diff --git a/src/store.ts b/src/store.ts index bd7a72ca..274c5f33 100644 --- a/src/store.ts +++ b/src/store.ts @@ -353,7 +353,7 @@ function createSetupStore< let ret: any try { ret = action.apply(this || store, args) - // Promise.resolve(ret).then(afterCallback).catch(onErrorCallback) + // handle sync errors } catch (error) { if (onErrorCallback(error) !== false) { throw error @@ -374,8 +374,8 @@ function createSetupStore< }) } + // allow the afterCallback to override the return value const newRet = afterCallback(ret) - return newRet === undefined ? ret : newRet } }