@logux/vuex
Advanced tools
Comparing version 0.9.2 to 0.9.3
# Change Log | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
## 0.9.3 | ||
* Fix `useStore` types, add lost `key` argument | ||
* Update dependencies | ||
* Logux Client to 0.9.2 | ||
* Vue to release candidate 6 | ||
## 0.9.2 | ||
@@ -5,0 +11,0 @@ * `useSubscription`’s argument `channels` can be a getter function |
@@ -33,8 +33,4 @@ import { VNodeProps } from 'vue' | ||
* export default { | ||
* components: { | ||
* Subscribe | ||
* }, | ||
* props: { | ||
* userId: String | ||
* }, | ||
* components: { Subscribe }, | ||
* props: ['userId'], | ||
* setup (props) { | ||
@@ -44,4 +40,4 @@ * let store = useStore() | ||
* | ||
* let user = computed(() => store.state.users[userId]) | ||
* let channels = computed(() => [`users/${userId}`]) | ||
* let user = computed(() => store.state.users[userId.value]) | ||
* let channels = computed(() => [`users/${userId.value}`]) | ||
* | ||
@@ -48,0 +44,0 @@ * return { |
@@ -38,11 +38,9 @@ import { | ||
* export default { | ||
* props: { | ||
* userId: String | ||
* }, | ||
* props: ['userId'], | ||
* setup (props) { | ||
* let store = useStore() | ||
* let { userId } = toRefs(props) | ||
* let isSubscribing = useSubscription(() => [`user/${userId}`]) | ||
* let isSubscribing = useSubscription(() => [`user/${userId.value}`]) | ||
* | ||
* let user = computed(() => store.state.users[userId]) | ||
* let user = computed(() => store.state.users[userId.value]) | ||
* | ||
@@ -49,0 +47,0 @@ * return { isSubscribing, user } |
@@ -0,1 +1,3 @@ | ||
import { InjectionKey } from 'vue' | ||
import { LoguxVuexStore } from './store' | ||
@@ -19,3 +21,3 @@ | ||
*/ | ||
export function useStore<S = any>(): LoguxVuexStore<S> | ||
export function useStore<S = any>(injectKey?: InjectionKey<LoguxVuexStore<S>> | string): LoguxVuexStore<S> | ||
@@ -22,0 +24,0 @@ export { Client, CrossTabClient } from '@logux/client' |
{ | ||
"name": "@logux/vuex", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"description": "Vuex compatible API for Logux", | ||
@@ -20,7 +20,7 @@ "keywords": [ | ||
"peerDependencies": { | ||
"vue": ">=3.0.0-rc.5", | ||
"vue": ">=3.0.0-rc.6", | ||
"vuex": ">=4.0.0-beta.4" | ||
}, | ||
"dependencies": { | ||
"@logux/client": "^0.9.1", | ||
"@logux/client": "^0.9.2", | ||
"@logux/core": "^0.6.1", | ||
@@ -49,2 +49,7 @@ "nanoevents": "^5.1.8" | ||
}, | ||
"./store/package.json": "./store/package.json", | ||
"./store": { | ||
"require": "./store/index.cjs", | ||
"import": "./store/index.js" | ||
}, | ||
"./utils/package.json": "./utils/package.json", | ||
@@ -54,9 +59,4 @@ "./utils": { | ||
"import": "./utils/index.js" | ||
}, | ||
"./store/package.json": "./store/package.json", | ||
"./store": { | ||
"require": "./store/index.cjs", | ||
"import": "./store/index.js" | ||
} | ||
} | ||
} |
@@ -85,11 +85,9 @@ # Logux Vuex | ||
export default { | ||
props: { | ||
userId: String | ||
}, | ||
props: ['userId'], | ||
setup (props) { | ||
let store = useStore() | ||
let { userId } = toRefs(props) | ||
let isSubscribing = useSubscription(() => [`user/${userId}`]) | ||
let isSubscribing = useSubscription(() => [`user/${userId.value}`]) | ||
let user = computed(() => store.state.users[userId]) | ||
let user = computed(() => store.state.users[userId.value]) | ||
@@ -122,8 +120,4 @@ return { | ||
export default { | ||
components: { | ||
Subscribe | ||
}, | ||
props: { | ||
userId: String | ||
}, | ||
components: { Subscribe }, | ||
props: ['userId'], | ||
setup (props) { | ||
@@ -133,4 +127,4 @@ let store = useStore() | ||
let user = computed(() => store.state.users[userId]) | ||
let channels = computed(() => [`users/${userId}`]) | ||
let user = computed(() => store.state.users[userId.value]) | ||
let channels = computed(() => [`users/${userId.value}`]) | ||
@@ -137,0 +131,0 @@ return { |
@@ -167,2 +167,8 @@ import { Unsubscribe } from 'nanoevents' | ||
/** | ||
* Vuex’s `createStore` function, compatible with Logux Client. | ||
* | ||
* @param options Vuex store options. | ||
* @returns Vuex store, compatible with Logux Client. | ||
*/ | ||
export interface createStore { | ||
@@ -201,3 +207,3 @@ <S>(options: VuexStoreOptions<S>): LoguxVuexStore<S> | ||
* @param options Logux Vuex options. | ||
* @returns Vuex’s `createStore` compatible function. | ||
* @returns Vuex’s `createStore` function, compatible with Logux Client. | ||
*/ | ||
@@ -204,0 +210,0 @@ export function createStoreCreator( |
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
52903
1427
157
Updated@logux/client@^0.9.2