@factor/app
Advanced tools
Comparing version 1.7.4 to 1.7.5
{ | ||
"name": "@factor/app", | ||
"version": "1.7.4", | ||
"version": "1.7.5", | ||
"license": "GPL-2.0", | ||
@@ -15,3 +15,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "774f448d04c6067d1d75c9af376a445c0f7fb8ae" | ||
"gitHead": "0396424ffc1264b0e0606ec87d7b0a5abdf8f07c" | ||
} |
18
store.ts
@@ -46,6 +46,10 @@ import Vuex from "vuex" | ||
/** | ||
* Store an item in application store/cache | ||
* | ||
* If a typical app function is used in an endpoint, then there will be no store | ||
* However we don't want to break code that would otherwise work | ||
*/ | ||
export const storeItem = (item: string, value: any): void => { | ||
if (!__store) { | ||
throw new Error(`Store not available for ${item}:${value}`) | ||
} | ||
if (!__store) return | ||
@@ -55,2 +59,6 @@ return __store.commit("setItem", { item, value }) | ||
/** | ||
* Get a reactive value from the application store | ||
* @param key - ID in the flat store | ||
*/ | ||
export const stored = (key?: string | ObjectId | number): any => { | ||
@@ -63,6 +71,4 @@ if (!__store || !key) return undefined | ||
export const getStoreState = (): Store<Record<string, any>>["state"] => { | ||
if (!__store) { | ||
throw new Error("Store not available for state.") | ||
} | ||
if (!__store) return {} | ||
return __store.state | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65424
834