Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@logux/client

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@logux/client - npm Package Compare versions

Comparing version 0.14.4 to 0.14.5

4

package.json
{
"name": "@logux/client",
"version": "0.14.4",
"version": "0.14.5",
"description": "Logux base components to build web client",

@@ -34,3 +34,3 @@ "keywords": [

"@nanostores/react": "^0.0.0",
"@nanostores/vue": "^0.4.1",
"@nanostores/vue": ">=0.5.3",
"nanostores": "^0.5.0",

@@ -37,0 +37,0 @@ "preact": ">=10.0.0",

import {
getCurrentInstance,
onErrorCaptured,
shallowRef,
reactive,

@@ -12,3 +13,3 @@ readonly,

toRef,
ref
unref
} from 'vue'

@@ -53,3 +54,3 @@ import { useStore } from '@nanostores/vue'

function useSyncStore(store) {
let error = ref(null)
let error = shallowRef(null)
let state = useStore(store)

@@ -76,6 +77,2 @@

if (typeof id === 'string') {
id = ref(id)
}
if (process.env.NODE_ENV !== 'production') {

@@ -86,22 +83,27 @@ checkErrorProcessor()

let client = useClient()
let state = reactive({})
watch(
id,
() => {
state.value = useSyncStore(Template(id.value, client, ...builderArgs))
},
{ immediate: true }
)
if (!isRef(id)) {
if (process.env.NODE_ENV !== 'production') {
return readonly(useSyncStore(Template(id, client, ...builderArgs)))
}
return useSyncStore(Template(id, client, ...builderArgs))
} else {
let state = reactive({})
if (process.env.NODE_ENV !== 'production') {
return readonly(toRef(state, 'value'))
watch(
id,
() => {
state.value = useSyncStore(Template(id.value, client, ...builderArgs))
},
{ immediate: true }
)
if (process.env.NODE_ENV !== 'production') {
return readonly(toRef(state, 'value'))
}
return toRef(state, 'value')
}
return toRef(state, 'value')
}
export function useFilter(Template, filter = {}, opts = {}) {
if (!isRef(filter)) filter = ref(filter)
if (!isRef(opts)) opts = ref(opts)
if (process.env.NODE_ENV !== 'production') {

@@ -112,18 +114,28 @@ checkErrorProcessor()

let client = useClient()
let state = reactive({})
watch(
[filter, opts],
() => {
state.value = useSyncStore(
createFilter(client, Template, filter.value, opts.value)
if (!isRef(filter) && !isRef(opts)) {
if (process.env.NODE_ENV !== 'production') {
return readonly(
useSyncStore(createFilter(client, Template, filter, opts))
)
},
{ deep: true, immediate: true }
)
}
return useSyncStore(createFilter(client, Template, filter, opts))
} else {
let state = reactive({})
if (process.env.NODE_ENV !== 'production') {
return readonly(toRef(state, 'value'))
watch(
() => ([unref(filter), unref(opts)]),
() => {
state.value = useSyncStore(
createFilter(client, Template, { ...filter.value }, { ...opts.value })
)
},
{ deep: true, immediate: true }
)
if (process.env.NODE_ENV !== 'production') {
return readonly(toRef(state, 'value'))
}
return toRef(state, 'value')
}
return toRef(state, 'value')
}

@@ -134,3 +146,3 @@

setup(props, { slots }) {
let error = ref(null)
let error = shallowRef(null)
let code = computed(() => {

@@ -137,0 +149,0 @@ if (!error.value) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc