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.13.1 to 0.13.2

6

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

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

"react-dom": ">=16.8.0",
"vue": ">=3.1.1"
"vue": ">=3.2.4"
},

@@ -58,4 +58,4 @@ "peerDependenciesMeta": {

"nanoevents": "^6.0.0",
"nanoid": "^3.1.23"
"nanoid": "^3.1.24"
}
}

@@ -14,3 +14,7 @@ import { useState, useContext, useEffect, useRef } from 'preact/hooks'

export function useClient() {
return useContext(ClientContext)
let client = useContext(ClientContext)
if (process.env.NODE_ENV !== 'production' && !client) {
throw new Error('Wrap components in Logux <ClientContext.Provider>')
}
return client
}

@@ -22,16 +26,3 @@

let value
if (process.env.NODE_ENV === 'production') {
value = getValue(store)
} else {
try {
value = getValue(store)
} catch (e) {
if (e.message === 'Missed Logux client') {
throw new Error('Wrap components in Logux <ClientContext.Provider>')
} else {
throw e
}
}
}
let value = getValue(store)

@@ -38,0 +29,0 @@ if (process.env.NODE_ENV !== 'production') {

@@ -13,3 +13,7 @@ import { useStore, batch } from 'nanostores/react'

export function useClient() {
return React.useContext(ClientContext)
let client = React.useContext(ClientContext)
if (process.env.NODE_ENV !== 'production' && !client) {
throw new Error('Wrap components in Logux <ClientContext.Provider>')
}
return client
}

@@ -20,18 +24,4 @@

let [, forceRender] = React.useState({})
let value = getValue(store)
let value
if (process.env.NODE_ENV === 'production') {
value = getValue(store)
} else {
try {
value = getValue(store)
} catch (e) {
if (e.message === 'Missed Logux client') {
throw new Error('Wrap components in Logux <ClientContext.Provider>')
} else {
throw e
}
}
}
if (process.env.NODE_ENV !== 'production') {

@@ -38,0 +28,0 @@ let errorProcessors = React.useContext(ErrorsContext) || {}

@@ -34,3 +34,10 @@ import {

export function useClient() {
return inject(ClientKey)
let client = inject(ClientKey)
if (process.env.NODE_ENV !== 'production' && !client) {
throw new Error(
`Install Logux Client using loguxPlugin: ` +
`app.use(loguxPlugin, client).`
)
}
return client
}

@@ -57,18 +64,3 @@

if (process.env.NODE_ENV === 'production') {
unsubscribe = store.subscribe(listener)
} else {
try {
unsubscribe = store.subscribe(listener)
} catch (e) {
if (e.message === 'Missed Logux client') {
throw new Error(
`Install Logux Client using loguxPlugin: ` +
`app.use(loguxPlugin, client).`
)
} else {
throw e
}
}
}
unsubscribe = store.subscribe(listener)

@@ -75,0 +67,0 @@ if (store.loading) {

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