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

rosma

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rosma - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

index.js

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

import{useState as t,useRef as e,useEffect as r,memo as n}from"react";function s(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}var i,o,c,a;o=new WeakMap,i=new WeakSet,c=function(t){s(this,o,"f")[t]||(s(this,o,"f")[t]={listeners:new Set})},a=function(t){const e=s(this,o,"f")[t].listeners,r=s(this,o,"f")[t].value;e.forEach((t=>t(r)))};const u=new class{constructor(){i.add(this),o.set(this,{})}subscribe(t,e){if("function"!=typeof e)return r=["listener must be a function"],console.warn(r.join("\n")),()=>!1;var r;s(this,i,"m",c).call(this,t);const n=s(this,o,"f")[t].listeners;return n.add(e),()=>n.delete(e)}set(t,{silent:e}={silent:!1}){"object"==typeof t&&Object.entries(t).forEach((([t,r])=>{s(this,i,"m",c).call(this,t),s(this,o,"f")[t].value=r,e||s(this,i,"m",a).call(this,t)}))}get(t){var e,r;return"string"==typeof t?null===(r=null===(e=s(this,o,"f"))||void 0===e?void 0:e[t])||void 0===r?void 0:r.value:Array.isArray(t)?Object.fromEntries(t.map((t=>[t,u.get(t)]))):void 0}isValid(t){return void 0!==s(this,o,"f")[t]}};function f(n){const s=t({}),i=e({keys:new Set});return r((()=>{const{keys:t}=i.current;if(0===t.size)return;const e=[];function r(t){s[1]({value:t})}return t.forEach((t=>e.push(u.subscribe(t,r)))),()=>{e.forEach((t=>t()))}}),[]),new Proxy({},{get(t,e){const{keys:r}=i.current;if((e=e.toLowerCase()).startsWith("set")){const t=e.replace("set","");return void 0!==n&&o(t),e=>{u.set({[t]:c(e,t)})}}return t[e]?t[e]:(r.add(e),o(e))}});function o(t){let e=u.get(t);return u.isValid(t)||(e=c(n,t),u.set({[t]:e})),e}function c(t,e){return"function"==typeof t?t(u.get(e)):t}}function l(t){function e(e){const r=f();return Object.defineProperties(r,Object.fromEntries(Object.entries(e).map((([t,e])=>[t,{value:e}])))),t(r)}return n(e)}export{u as observer,f as useObserver,l as withState};
import{useState as t,useRef as e,useEffect as r,memo as n}from"react";function s(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}var i,o,c,a;o=new WeakMap,i=new WeakSet,c=function(t){s(this,o,"f")[t]||(s(this,o,"f")[t]={listeners:new Set})},a=function(t){const e=s(this,o,"f")[t].listeners,r=s(this,o,"f")[t].value;e.forEach((t=>t(r)))};const u=new class{constructor(){i.add(this),o.set(this,{})}subscribe(t,e){if("function"!=typeof e)return r=["listener must be a function"],console.warn(r.join("\n")),()=>!1;var r;s(this,i,"m",c).call(this,t);const n=s(this,o,"f")[t].listeners;return n.add(e),()=>n.delete(e)}set(t,{silent:e}={silent:!1}){"object"==typeof t&&Object.entries(t).forEach((([t,r])=>{s(this,i,"m",c).call(this,t),s(this,o,"f")[t].value=r,e||s(this,i,"m",a).call(this,t)}))}get(t){var e,r;return"string"==typeof t?null===(r=null===(e=s(this,o,"f"))||void 0===e?void 0:e[t.toLowerCase()])||void 0===r?void 0:r.value:Array.isArray(t)?Object.fromEntries(t.map((t=>[t,u.get(t)]))):void 0}isValid(t){return void 0!==s(this,o,"f")[t]}};function f(n){const s=t({}),i=e({keys:new Set});return r((()=>{const{keys:t}=i.current;if(0===t.size)return;const e=[];function r(t){s[1]({value:t})}return t.forEach((t=>e.push(u.subscribe(t,r)))),()=>{e.forEach((t=>t()))}}),[]),new Proxy({},{get(t,e){const{keys:r}=i.current;if((e=e.toLowerCase()).startsWith("set")){const t=e.replace("set","");return void 0!==n&&o(t),e=>{u.set({[t]:c(e,t)})}}return t[e]?t[e]:(r.add(e),o(e))}});function o(t){let e=u.get(t);return u.isValid(t)||(e=c(n,t),u.set({[t]:e})),e}function c(t,e){return"function"==typeof t?t(u.get(e)):t}}function l(t){function e(e){const r=f();return Object.defineProperties(r,Object.fromEntries(Object.entries(e).map((([t,e])=>[t,{value:e}])))),t(r)}return n(e)}export{u as observer,f as useObserver,l as withState};
{
"name": "rosma",
"version": "1.1.0",
"version": "1.1.1",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

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