@logux/vuex
Advanced tools
Comparing version
# Change Log | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
## 0.9.7 | ||
* Add `store` option from `useSubscription` to support different store sources. | ||
## 0.9.6 | ||
@@ -5,0 +8,0 @@ * Update Vue to release candidate 9 |
@@ -7,2 +7,4 @@ import { | ||
import { LoguxVuexStore } from '..' | ||
export type Channel = | ||
@@ -20,2 +22,9 @@ | string | ||
export type useSubscriptionOptions = { | ||
/** | ||
* Logux Vuex store. | ||
*/ | ||
store: LoguxVuexStore | ||
} | ||
/** | ||
@@ -55,6 +64,8 @@ * Composable function that subscribes | ||
* @param channels Channels to subscribe. | ||
* @param opts Options. | ||
* @return `true` during data loading. | ||
*/ | ||
export function useSubscription ( | ||
channels: Channels | ||
channels: Channels, | ||
options: useSubscriptionOptions | ||
): Ref<boolean> |
@@ -13,5 +13,5 @@ import { useStore } from 'vuex' | ||
function useSubscription (channels) { | ||
function useSubscription (channels, options = {}) { | ||
let isSubscribing = ref(true) | ||
let store = useStore() | ||
let store = options.store || useStore() | ||
@@ -18,0 +18,0 @@ if (isRef(channels) || isFunction(channels)) { |
{ | ||
"name": "@logux/vuex", | ||
"version": "0.9.6", | ||
"version": "0.9.7", | ||
"description": "Vuex compatible API for Logux", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
53404
0.66%1436
0.63%