@magnetarjs/plugin-vue3
Advanced tools
Comparing version 0.10.1 to 0.11.0
@@ -152,3 +152,3 @@ "use strict"; | ||
var import_utils = require("@magnetarjs/utils"); | ||
function fetchActionFactory(data, Vue3StoreOptions) { | ||
function fetchActionFactory(data, exists, Vue3StoreOptions) { | ||
return function({ | ||
@@ -201,2 +201,10 @@ payload, | ||
const doOnFetchAction = (_payload, meta) => { | ||
const docPath = `${collectionPath}/${docId}`; | ||
if (meta === "error") { | ||
exists[docPath] = "error"; | ||
return; | ||
} | ||
if (meta?.exists !== "unknown") { | ||
exists[`${collectionPath}/${docId}`] = meta.exists; | ||
} | ||
if (_payload === void 0) | ||
@@ -210,3 +218,3 @@ return; | ||
collectionPath, | ||
docId: docId || ((0, import_is_what5.isFullString)(meta.id) ? meta.id : (0, import_is_what5.isNumber)(meta.id) ? `${meta.id}` : void 0), | ||
docId: docId || ((0, import_is_what5.isFullString)(meta?.id) ? meta.id : (0, import_is_what5.isNumber)(meta?.id) ? `${meta.id}` : void 0), | ||
actionConfig, | ||
@@ -328,2 +336,3 @@ pluginModuleConfig | ||
const data = {}; | ||
const exists = (0, import_vue.reactive)({}); | ||
const pathCountDic = (0, import_vue.reactive)({}); | ||
@@ -396,2 +405,8 @@ const dataBackups = {}; | ||
}; | ||
const getModuleExists = ({ | ||
collectionPath, | ||
docId | ||
}) => { | ||
return exists[`${collectionPath}/${docId}`]; | ||
}; | ||
const getModuleCount = ({ | ||
@@ -410,3 +425,3 @@ collectionPath, | ||
}; | ||
const fetch = fetchActionFactory(data, vue3StoreOptions); | ||
const fetch = fetchActionFactory(data, exists, vue3StoreOptions); | ||
const fetchCount = fetchCountActionFactory(pathCountDic, vue3StoreOptions); | ||
@@ -436,2 +451,3 @@ const stream = streamActionFactory(data, vue3StoreOptions); | ||
getModuleData, | ||
getModuleExists, | ||
getModuleCount | ||
@@ -438,0 +454,0 @@ }; |
{ | ||
"name": "@magnetarjs/plugin-vue3", | ||
"version": "0.10.1", | ||
"version": "0.11.0", | ||
"sideEffects": false, | ||
@@ -26,4 +26,4 @@ "description": "Magnetar plugin vue3", | ||
"dependencies": { | ||
"@magnetarjs/types": "0.10.1", | ||
"@magnetarjs/utils": "0.10.1", | ||
"@magnetarjs/types": "0.11.0", | ||
"@magnetarjs/utils": "0.11.0", | ||
"copy-anything": "^3.0.2", | ||
@@ -37,4 +37,4 @@ "filter-anything": "^3.0.3", | ||
"devDependencies": { | ||
"@magnetarjs/core": "0.10.1", | ||
"@magnetarjs/test-utils": "0.10.1", | ||
"@magnetarjs/core": "0.11.0", | ||
"@magnetarjs/test-utils": "0.11.0", | ||
"vue": "^3.2.45" | ||
@@ -41,0 +41,0 @@ }, |
Sorry, the diff of this file is not supported yet
31908
882
+ Added@magnetarjs/types@0.11.0(transitive)
+ Added@magnetarjs/utils@0.11.0(transitive)
- Removed@magnetarjs/types@0.10.1(transitive)
- Removed@magnetarjs/utils@0.10.1(transitive)
Updated@magnetarjs/types@0.11.0
Updated@magnetarjs/utils@0.11.0