@nanostores/vue
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -39,9 +39,1 @@ import { AnySyncTemplate, MapTemplate, Store } from 'nanostores' | ||
): void | ||
/** | ||
* Registers the store for the component inspector | ||
* | ||
* @param store Any store | ||
* @private | ||
*/ | ||
export function registerStore(store: AnyStore): void |
@@ -10,3 +10,2 @@ import { | ||
import { setupDevtoolsPlugin } from '@vue/devtools-api' | ||
import { getCurrentInstance } from 'vue' | ||
@@ -401,10 +400,1 @@ const layerId = 'nanostores' | ||
} | ||
export function registerStore(store) { | ||
let instance = getCurrentInstance() | ||
if (instance && instance.proxy) { | ||
let vm = instance.proxy | ||
let cache = '_nanostores' in vm ? vm._nanostores : (vm._nanostores = []) | ||
cache.push(store) | ||
} | ||
} |
{ | ||
"name": "@nanostores/vue", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"description": "Vue integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -27,4 +27,4 @@ import { DeepReadonly, Ref } from 'vue' | ||
* | ||
* @param store Store instance. | ||
* @returns Store value. | ||
* @param store Store instance | ||
* @returns Store value | ||
*/ | ||
@@ -35,1 +35,9 @@ export function useStore< | ||
>(store: SomeStore): DeepReadonly<Ref<Value>> | ||
/** | ||
* Registers the store for the devtools component inspector. | ||
* | ||
* @param store Store instance | ||
* @private | ||
*/ | ||
export function registerStore(store: AnyStore): void |
@@ -1,4 +0,17 @@ | ||
import { getCurrentScope, onScopeDispose, readonly, shallowRef } from 'vue' | ||
import { | ||
getCurrentInstance, | ||
getCurrentScope, | ||
onScopeDispose, | ||
readonly, | ||
shallowRef | ||
} from 'vue' | ||
import { registerStore } from '../devtools/index.js' | ||
export function registerStore(store) { | ||
let instance = getCurrentInstance() | ||
if (instance && instance.proxy) { | ||
let vm = instance.proxy | ||
let cache = '_nanostores' in vm ? vm._nanostores : (vm._nanostores = []) | ||
cache.push(store) | ||
} | ||
} | ||
@@ -5,0 +18,0 @@ export function useStore(store) { |
603
18693