vuex-composition-helpers
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -1,5 +0,8 @@ | ||
import { computed } from 'vue'; | ||
import { computed, readonly } from 'vue'; | ||
import { computedGetter, getAction, getMutation, getStoreFromInstance, useMapping } from './util'; | ||
function computedState(store, prop) { | ||
return computed(() => store.state[prop]); | ||
return computed(() => { | ||
const val = store.state[prop]; | ||
return typeof val === 'object' ? readonly(val) : val; | ||
}); | ||
} | ||
@@ -6,0 +9,0 @@ export function useStore() { |
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'jsdom', | ||
globals: { | ||
'ts-jest': { | ||
tsConfig: 'tsconfig.test.json' | ||
tsconfig: 'tsconfig.test.json' | ||
} | ||
} | ||
}; |
{ | ||
"name": "vuex-composition-helpers", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Helpers to use Vuex store form Vue Composition API", | ||
@@ -34,7 +34,7 @@ "author": "David Meir-Levy <davidmeirlevy@gmail.com>", | ||
"devDependencies": { | ||
"@types/jest": "^25.2.1", | ||
"@types/jest": "^27.4.1", | ||
"@vue/compiler-sfc": "^3.0.5", | ||
"@vue/test-utils": "^2.0.0-rc.0", | ||
"jest": "^25.3.0", | ||
"ts-jest": "^25.3.1", | ||
"jest": "^27.5.1", | ||
"ts-jest": "^27.1.3", | ||
"typescript": "^3.8.2", | ||
@@ -41,0 +41,0 @@ "vue": "^3.0.5", |
import {Store} from 'vuex/types'; | ||
import {computed} from 'vue'; | ||
import {computed, readonly} from 'vue'; | ||
import {computedGetter, getAction, getMutation, getStoreFromInstance, useMapping, ExtractGetterTypes, ExtractTypes, KnownKeys, RefTypes} from './util'; | ||
function computedState(store: any, prop: string) { | ||
return computed(() => store.state[prop]); | ||
return computed(() => { | ||
const val = store.state[prop]; | ||
return typeof val === 'object' ? readonly(val) : val | ||
}); | ||
} | ||
@@ -8,0 +11,0 @@ |
Sorry, the diff of this file is not supported yet
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
35870
515