Comparing version 0.0.11 to 0.0.12
/* | ||
* only-state.js 0.0.11 | ||
* only-state.js 0.0.12 | ||
* author:webszy | ||
* date:2022/5/12 上午10:08:16 | ||
* date:2022/5/13 上午11:43:13 | ||
*/ | ||
@@ -6,0 +6,0 @@ import { reactive, computed, toRefs } from 'vue'; |
{ | ||
"name": "onlystate", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "A state and only state management library for Vue3", | ||
@@ -5,0 +5,0 @@ "main": "dist/only-state.js", |
@@ -53,3 +53,3 @@ | ||
const hasKey = (keyName:string) => keyName in _State.state | ||
const getOne = (keyName:string) => hasKey(keyName) ? toRefs(_State .state)[keyName] : undefined | ||
const getOne = (keyName:string) => hasKey(keyName) ? toRefs(_State.state)[keyName] : <any>undefined | ||
if(len === 0){ | ||
@@ -78,3 +78,3 @@ return _State.state | ||
const hasKey = (keyName:string) => keyName in _State.getters | ||
const getOne = (keyName:string) => hasKey(keyName) ? _State.getters[keyName] : undefined | ||
const getOne = (keyName:string) => hasKey(keyName) ? _State.getters[keyName] : <any>undefined | ||
if(len === 0){ | ||
@@ -81,0 +81,0 @@ return _State.getters |
@@ -6,14 +6,4 @@ export declare const defineState: (state: { | ||
}; | ||
export declare const useState: (key: string | string[], ...rest: any[]) => { | ||
[key: string]: any; | ||
} | undefined; | ||
export declare const useGetters: (key: string | string[], ...rest: any[]) => false | { | ||
value?: any; | ||
} | { | ||
[key: string]: { | ||
value?: any; | ||
}; | ||
} | ({ | ||
value?: any; | ||
} | undefined)[] | undefined; | ||
export declare const useState: (key: string | string[], ...rest: any[]) => any; | ||
export declare const useGetters: (key: string | string[], ...rest: any[]) => any; | ||
export declare const stateToRefs: () => { | ||
@@ -32,14 +22,4 @@ [x: string]: { | ||
}; | ||
useState: (key: string | string[], ...rest: any[]) => { | ||
[key: string]: any; | ||
} | undefined; | ||
useGetters: (key: string | string[], ...rest: any[]) => false | { | ||
value?: any; | ||
} | { | ||
[key: string]: { | ||
value?: any; | ||
}; | ||
} | ({ | ||
value?: any; | ||
} | undefined)[] | undefined; | ||
useState: (key: string | string[], ...rest: any[]) => any; | ||
useGetters: (key: string | string[], ...rest: any[]) => any; | ||
stateToRefs: () => { | ||
@@ -46,0 +26,0 @@ [x: string]: { |
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
33334
711