New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@blac/react

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blac/react - npm Package Compare versions

Comparing version 0.0.27 to 0.0.28

2

index.cjs.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("blac"),l=require("react"),i=(a,s)=>{let e=s(a.state);return{subscribe:u=>{const r=a.addEventListenerStateChange(c=>{const t=s(c);let d=!0;for(let o=0;o<t.length;o++)if(t[o]!==e[o]){d=!1;break}d||(e=t,u())});return()=>{r()}},getSnapshot:()=>a.state,getServerSnapshot:()=>a.state}};class y{static useBloc(s,e){const u=l.useId();let r=B=>[B],c,t;typeof e=="function"&&(r=e),typeof e=="string"&&(c=e),typeof e=="object"&&(r=e.dependencySelector??r,c=e.id,t=e.props??t),s.isolated&&(c=u);const n=h.Blac.getInstance().getBloc(s,{id:c,props:t,reconnect:!1});if(!n)throw new Error(`useBloc: could not resolve: ${s.name||s}`);const{subscribe:f,getSnapshot:S,getServerSnapshot:p}=l.useMemo(()=>i(n,r),[n.createdAt]),g=l.useSyncExternalStore(f,S,p);return l.useEffect(()=>{t&&!n.props&&(n.props=t)},[t]),[g,n]}}const b=y.useBloc;exports.externalBlocStore=i;exports.useBloc=b;
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("blac"),l=require("react"),f=(r,s)=>{let e=s(r.state);return{subscribe:u=>{const c=r.addEventListenerStateChange(n=>{try{const t=s(n)??[];let i=!0;for(let a=0;a<t.length;a++)if(t[a]!==e[a]){i=!1;break}i||(e=t,u())}catch(t){console.error({e:t,bloc:r,dependencyArray:s,lastDependencyCheck:e})}});return()=>{c()}},getSnapshot:()=>r.state,getServerSnapshot:()=>r.state}};class y{static useBloc(s,e){const u=l.useId();let c=B=>[B],n,t;typeof e=="function"&&(c=e),typeof e=="string"&&(n=e),typeof e=="object"&&(c=e.dependencySelector??c,n=e.id,t=e.props??t),s.isolated&&(n=u);const o=h.Blac.getInstance().getBloc(s,{id:n,props:t,reconnect:!1});if(!o)throw new Error(`useBloc: could not resolve: ${s.name||s}`);const{subscribe:d,getSnapshot:S,getServerSnapshot:g}=l.useMemo(()=>f(o,c),[o.createdAt]),p=l.useSyncExternalStore(d,S,g);return l.useEffect(()=>{t&&!o.props&&(o.props=t)},[t]),[p,o]}}const b=y.useBloc;exports.externalBlocStore=f;exports.useBloc=b;
//# sourceMappingURL=index.cjs.js.map

@@ -1,23 +0,32 @@

import { Blac as g } from "blac";
import { useId as h, useMemo as B, useSyncExternalStore as y, useEffect as m } from "react";
const v = (o, s) => {
let e = s(o.state);
import { Blac as h } from "blac";
import { useId as g, useMemo as B, useSyncExternalStore as m, useEffect as y } from "react";
const v = (r, s) => {
let e = s(r.state);
return {
subscribe: (l) => {
const r = o.addEventListenerStateChange((n) => {
const t = s(n);
let f = !0;
for (let a = 0; a < t.length; a++)
if (t[a] !== e[a]) {
f = !1;
break;
}
f || (e = t, l());
const c = r.addEventListenerStateChange((n) => {
try {
const t = s(n) ?? [];
let f = !0;
for (let a = 0; a < t.length; a++)
if (t[a] !== e[a]) {
f = !1;
break;
}
f || (e = t, l());
} catch (t) {
console.error({
e: t,
bloc: r,
dependencyArray: s,
lastDependencyCheck: e
});
}
});
return () => {
r();
c();
};
},
getSnapshot: () => o.state,
getServerSnapshot: () => o.state
getSnapshot: () => r.state,
getServerSnapshot: () => r.state
};

@@ -27,6 +36,6 @@ };

static useBloc(s, e) {
const l = h();
let r = (S) => [S], n, t;
typeof e == "function" && (r = e), typeof e == "string" && (n = e), typeof e == "object" && (r = e.dependencySelector ?? r, n = e.id, t = e.props ?? t), s.isolated && (n = l);
const c = g.getInstance().getBloc(s, {
const l = g();
let c = (S) => [S], n, t;
typeof e == "function" && (c = e), typeof e == "string" && (n = e), typeof e == "object" && (c = e.dependencySelector ?? c, n = e.id, t = e.props ?? t), s.isolated && (n = l);
const o = h.getInstance().getBloc(s, {
id: n,

@@ -36,22 +45,22 @@ props: t,

});
if (!c)
if (!o)
throw new Error(`useBloc: could not resolve: ${s.name || s}`);
const { subscribe: u, getSnapshot: d, getServerSnapshot: i } = B(
() => v(c, r),
[c.createdAt]
), p = y(
const { subscribe: u, getSnapshot: i, getServerSnapshot: d } = B(
() => v(o, c),
[o.createdAt]
), p = m(
u,
d,
i
i,
d
);
return m(() => {
t && !c.props && (c.props = t);
}, [t]), [p, c];
return y(() => {
t && !o.props && (o.props = t);
}, [t]), [p, o];
}
}
const C = E.useBloc;
const b = E.useBloc;
export {
v as externalBlocStore,
C as useBloc
b as useBloc
};
//# sourceMappingURL=index.es.js.map
{
"name": "@blac/react",
"version": "0.0.27",
"version": "0.0.28",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "index.cjs.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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