fix price and modular
This commit is contained in:
+17
-20
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* pinia v3.0.3
|
||||
* pinia v3.0.4
|
||||
* (c) 2025 Eduardo San Martin Morote
|
||||
* @license MIT
|
||||
*/
|
||||
@@ -145,13 +145,10 @@ function acceptHMRUpdate(initialUseStore, hot) {
|
||||
|
||||
const noop = () => { };
|
||||
function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
|
||||
subscriptions.push(callback);
|
||||
subscriptions.add(callback);
|
||||
const removeSubscription = () => {
|
||||
const idx = subscriptions.indexOf(callback);
|
||||
if (idx > -1) {
|
||||
subscriptions.splice(idx, 1);
|
||||
onCleanup();
|
||||
}
|
||||
const isDel = subscriptions.delete(callback);
|
||||
isDel && onCleanup();
|
||||
};
|
||||
if (!detached && vue.getCurrentScope()) {
|
||||
vue.onScopeDispose(removeSubscription);
|
||||
@@ -159,7 +156,7 @@ function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
|
||||
return removeSubscription;
|
||||
}
|
||||
function triggerSubscriptions(subscriptions, ...args) {
|
||||
subscriptions.slice().forEach((callback) => {
|
||||
subscriptions.forEach((callback) => {
|
||||
callback(...args);
|
||||
});
|
||||
}
|
||||
@@ -268,8 +265,8 @@ function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore)
|
||||
// internal state
|
||||
let isListening; // set to true at the end
|
||||
let isSyncListening; // set to true at the end
|
||||
let subscriptions = [];
|
||||
let actionSubscriptions = [];
|
||||
let subscriptions = new Set();
|
||||
let actionSubscriptions = new Set();
|
||||
let debuggerEvents;
|
||||
const initialState = pinia.state.value[$id];
|
||||
// avoid setting the state for option stores if it is set
|
||||
@@ -326,8 +323,8 @@ function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore)
|
||||
noop;
|
||||
function $dispose() {
|
||||
scope.stop();
|
||||
subscriptions = [];
|
||||
actionSubscriptions = [];
|
||||
subscriptions.clear();
|
||||
actionSubscriptions.clear();
|
||||
pinia._s.delete($id);
|
||||
}
|
||||
/**
|
||||
@@ -343,13 +340,13 @@ function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore)
|
||||
const wrappedAction = function () {
|
||||
setActivePinia(pinia);
|
||||
const args = Array.from(arguments);
|
||||
const afterCallbackList = [];
|
||||
const onErrorCallbackList = [];
|
||||
const afterCallbackSet = new Set();
|
||||
const onErrorCallbackSet = new Set();
|
||||
function after(callback) {
|
||||
afterCallbackList.push(callback);
|
||||
afterCallbackSet.add(callback);
|
||||
}
|
||||
function onError(callback) {
|
||||
onErrorCallbackList.push(callback);
|
||||
onErrorCallbackSet.add(callback);
|
||||
}
|
||||
// @ts-expect-error
|
||||
triggerSubscriptions(actionSubscriptions, {
|
||||
@@ -365,22 +362,22 @@ function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore)
|
||||
// handle sync errors
|
||||
}
|
||||
catch (error) {
|
||||
triggerSubscriptions(onErrorCallbackList, error);
|
||||
triggerSubscriptions(onErrorCallbackSet, error);
|
||||
throw error;
|
||||
}
|
||||
if (ret instanceof Promise) {
|
||||
return ret
|
||||
.then((value) => {
|
||||
triggerSubscriptions(afterCallbackList, value);
|
||||
triggerSubscriptions(afterCallbackSet, value);
|
||||
return value;
|
||||
})
|
||||
.catch((error) => {
|
||||
triggerSubscriptions(onErrorCallbackList, error);
|
||||
triggerSubscriptions(onErrorCallbackSet, error);
|
||||
return Promise.reject(error);
|
||||
});
|
||||
}
|
||||
// trigger after callbacks
|
||||
triggerSubscriptions(afterCallbackList, ret);
|
||||
triggerSubscriptions(afterCallbackSet, ret);
|
||||
return ret;
|
||||
};
|
||||
wrappedAction[ACTION_MARKER] = true;
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
../../.nitro/vue@3.5.22
|
||||
../../.nitro/vue@3.5.14
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pinia",
|
||||
"version": "3.0.3",
|
||||
"version": "3.0.4",
|
||||
"description": "Intuitive, type safe and flexible Store for Vue",
|
||||
"type": "module",
|
||||
"main": "index.cjs",
|
||||
@@ -61,15 +61,15 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "7.49.2",
|
||||
"@microsoft/api-extractor": "7.53.3",
|
||||
"@vue/test-utils": "^2.4.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/devtools-api": "^7.7.2"
|
||||
"@vue/devtools-api": "^7.7.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.4.4",
|
||||
"vue": "^2.7.0 || ^3.5.11"
|
||||
"typescript": ">=4.5.0",
|
||||
"vue": "^3.5.11"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
|
||||
Reference in New Issue
Block a user