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

uhooks-fx

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uhooks-fx - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

4

async.js

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

self.uhooksFX=function(e){"use strict";var t=Promise;let n=null,s=new Set;const a=new WeakMap,c=e=>{const{$:t,r:n,h:s}=e;p(n)&&(u.get(s).delete(e),n()),p(e.r=t())&&u.get(s).add(e)},r=()=>{const e=s;s=new Set,e.forEach((({h:e,c:t,a:n,e:s})=>{s&&e.apply(t,n)}))},u=new WeakMap,o=[],l=[];function h(e,t){return e!==this[t]}const i=()=>a.get(n),p=e=>"function"==typeof e,f=e=>{const t={h:s,c:null,a:null,e:0,i:0,s:[]};return a.set(s,t),s;function s(){const a=n;n=s,t.e=t.i=0;try{return e.apply(t.c=this,t.a=arguments)}finally{n=a,o.length&&d.then(o.forEach.bind(o.splice(0),c)),l.length&&l.splice(0).forEach(c)}}},d=new t((e=>e()));function y(e){const{_:t,value:n}=this;n!==e&&(this._=new Set,this.value=e,t.forEach((({h:e,c:t,a:n})=>{e.apply(t,n)})))}const w=(e,t)=>{const n=i(),{i:s,s:a}=n;return s!==a.length&&t&&!t.some(h,a[s]._)||(a[s]={$:e(),_:t}),a[n.i++].$},g=e=>(t,n)=>{const s=i(),{i:a,s:c,h:r}=s,o=a===c.length;s.i++,o&&(u.has(r)||u.set(r,new Set),c[a]={$:t,_:n,r:null,h:r}),(o||!n||n.some(h,c[a]._))&&e.push(c[a]),c[a].$=t,c[a]._=n},_=g(o),v=g(l),E=(e,t)=>p(t)?t(e):t,$=(e,t,n)=>{const a=i(),{i:c,s:u}=a;c===u.length&&u.push({$:p(n)?n(t):E(void 0,t),set:t=>{u[c].$=e(u[c].$,t),(e=>{s.has(e)||(e.e=1,s.add(e),d.then(r))})(a)}});const{$:o,set:l}=u[a.i++];return[o,l]},k=new WeakMap,M=e=>{const t=f(e);return k.set(n,t),n;async function n(){return await t.apply(this,arguments)}};
self.uhooksFX=function(e){"use strict";var t=Promise;let n=null,s=new Set;const a=e=>{const{$:t,r:n,h:s}=e;i(n)&&(r.get(s).delete(e),n()),i(e.r=t())&&r.get(s).add(e)},c=()=>{const e=s;s=new Set,e.forEach((({h:e,c:t,a:n,e:s})=>{s&&e.apply(t,n)}))},r=new WeakMap,u=[],o=[];function l(e,t){return e!==this[t]}const h=()=>n,i=e=>"function"==typeof e,f=e=>{const t={h:s,c:null,a:null,e:0,i:0,s:[]};return s;function s(){const s=n;n=t,t.e=t.i=0;try{return e.apply(t.c=this,t.a=arguments)}finally{n=s,u.length&&p.then(u.forEach.bind(u.splice(0),a)),o.length&&o.splice(0).forEach(a)}}},p=new t((e=>e()));function d(e){const{_:t,value:n}=this;n!==e&&(this._=new Set,this.value=e,t.forEach((({h:e,c:t,a:n})=>{e.apply(t,n)})))}const y=(e,t)=>{const n=h(),{i:s,s:a}=n;return s!==a.length&&t&&!t.some(l,a[s]._)||(a[s]={$:e(),_:t}),a[n.i++].$},w=e=>(t,n)=>{const s=h(),{i:a,s:c,h:u}=s,o=a===c.length;s.i++,o&&(r.has(u)||r.set(u,new Set),c[a]={$:t,_:n,r:null,h:u}),(o||!n||n.some(l,c[a]._))&&e.push(c[a]),c[a].$=t,c[a]._=n},g=w(u),_=w(o),v=(e,t)=>i(t)?t(e):t,E=(e,t,n)=>{const a=h(),{i:r,s:u}=a;r===u.length&&u.push({$:i(n)?n(t):v(void 0,t),set:t=>{u[r].$=e(u[r].$,t),(e=>{s.has(e)||(e.e=1,s.add(e),p.then(c))})(a)}});const{$:o,set:l}=u[a.i++];return[o,l]},$=new WeakMap,k=e=>{const t=f(e);return $.set(n,t),n;async function n(){return await t.apply(this,arguments)}};
/*! (c) Andrea Giammarchi - ISC */
let S=null,W=null,m=null;const b=new WeakMap,C=new WeakMap,x=(e,t,n,s)=>{const a=a=>{b.has(e)||(b.set(e,0),d.then((()=>{b.delete(e),e.apply(t,n)}))),s(a)};return C.set(s,a),a},P=(e,t,n,s)=>e?[s[0],C.get(s[1])||x(e,t,n,s[1])]:s;return e.createContext=e=>({_:new Set,provide:y,value:e}),e.dropEffect=e=>(e=>{const t=u.get(e);t&&d.then((()=>{t.forEach((e=>{e.r(),e.r=null})),t.clear()}))})(k.get(e)),e.hasEffect=e=>(e=>u.has(e))(k.get(e)),e.hooked=(e,t)=>{const n=M(t?async function(){const[t,s,a]=[S,W,m];[S,W,m]=[n,this,arguments];try{return await e.apply(W,m)}finally{[S,W,m]=[t,s,a]}}:e);return n},e.useCallback=(e,t)=>w((()=>e),t),e.useContext=({_:e,value:t})=>(e.add(i()),t),e.useEffect=_,e.useLayoutEffect=v,e.useMemo=w,e.useReducer=(e,t,n)=>P(S,W,m,$(e,t,n)),e.useRef=e=>{const t=i(),{i:n,s:s}=t;return n===s.length&&s.push({current:e}),s[t.i++]},e.useState=e=>P(S,W,m,(e=>$(E,e))(e)),e.wait=d,e}({});
let M=null,S=null,m=null;const W=new WeakMap,b=new WeakMap,C=(e,t,n,s)=>{const a=a=>{W.has(e)||(W.set(e,0),p.then((()=>{W.delete(e),e.apply(t,n)}))),s(a)};return b.set(s,a),a},x=(e,t,n,s)=>e?[s[0],b.get(s[1])||C(e,t,n,s[1])]:s;return e.createContext=e=>({_:new Set,provide:d,value:e}),e.dropEffect=e=>(e=>{const t=r.get(e);t&&p.then((()=>{t.forEach((e=>{e.r(),e.r=null})),t.clear()}))})($.get(e)),e.hasEffect=e=>(e=>r.has(e))($.get(e)),e.hooked=(e,t)=>{const n=k(t?async function(){const[t,s,a]=[M,S,m];[M,S,m]=[n,this,arguments];try{return await e.apply(S,m)}finally{[M,S,m]=[t,s,a]}}:e);return n},e.useCallback=(e,t)=>y((()=>e),t),e.useContext=({_:e,value:t})=>(e.add(h()),t),e.useEffect=g,e.useLayoutEffect=_,e.useMemo=y,e.useReducer=(e,t,n)=>x(M,S,m,E(e,t,n)),e.useRef=e=>{const t=h(),{i:n,s:s}=t;return n===s.length&&s.push({current:e}),s[t.i++]},e.useState=e=>x(M,S,m,(e=>E(v,e))(e)),e.wait=p,e}({});

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

self.uhooksFX=function(e){"use strict";var t=Promise;let n=null,s=new Set;const a=new WeakMap,c=e=>{const{$:t,r:n,h:s}=e;f(n)&&(o.get(s).delete(e),n()),f(e.r=t())&&o.get(s).add(e)},l=()=>{const e=s;s=new Set,e.forEach((({h:e,c:t,a:n,e:s})=>{s&&e.apply(t,n)}))},o=new WeakMap,u=[],r=[];function h(e,t){return e!==this[t]}const i=()=>a.get(n),f=e=>"function"==typeof e,p=e=>{const t={h:s,c:null,a:null,e:0,i:0,s:[]};return a.set(s,t),s;function s(){const a=n;n=s,t.e=t.i=0;try{return e.apply(t.c=this,t.a=arguments)}finally{n=a,u.length&&d.then(u.forEach.bind(u.splice(0),c)),r.length&&r.splice(0).forEach(c)}}},d=new t((e=>e()));function y(e){const{_:t,value:n}=this;n!==e&&(this._=new Set,this.value=e,t.forEach((({h:e,c:t,a:n})=>{e.apply(t,n)})))}const g=(e,t)=>{const n=i(),{i:s,s:a}=n;return s!==a.length&&t&&!t.some(h,a[s]._)||(a[s]={$:e(),_:t}),a[n.i++].$},w=e=>(t,n)=>{const s=i(),{i:a,s:c,h:l}=s,u=a===c.length;s.i++,u&&(o.has(l)||o.set(l,new Set),c[a]={$:t,_:n,r:null,h:l}),(u||!n||n.some(h,c[a]._))&&e.push(c[a]),c[a].$=t,c[a]._=n},_=w(u),v=w(r),E=(e,t)=>f(t)?t(e):t,$=(e,t,n)=>{const a=i(),{i:c,s:o}=a;c===o.length&&o.push({$:f(n)?n(t):E(void 0,t),set:t=>{o[c].$=e(o[c].$,t),(e=>{s.has(e)||(e.e=1,s.add(e),d.then(l))})(a)}});const{$:u,set:r}=o[a.i++];return[u,r]};
self.uhooksFX=function(e){"use strict";var t=Promise;let n=null,s=new Set;const c=e=>{const{$:t,r:n,h:s}=e;i(n)&&(o.get(s).delete(e),n()),i(e.r=t())&&o.get(s).add(e)},l=()=>{const e=s;s=new Set,e.forEach((({h:e,c:t,a:n,e:s})=>{s&&e.apply(t,n)}))},o=new WeakMap,u=[],r=[];function a(e,t){return e!==this[t]}const h=()=>n,i=e=>"function"==typeof e,f=e=>{const t={h:s,c:null,a:null,e:0,i:0,s:[]};return s;function s(){const s=n;n=t,t.e=t.i=0;try{return e.apply(t.c=this,t.a=arguments)}finally{n=s,u.length&&p.then(u.forEach.bind(u.splice(0),c)),r.length&&r.splice(0).forEach(c)}}},p=new t((e=>e()));function d(e){const{_:t,value:n}=this;n!==e&&(this._=new Set,this.value=e,t.forEach((({h:e,c:t,a:n})=>{e.apply(t,n)})))}const y=(e,t)=>{const n=h(),{i:s,s:c}=n;return s!==c.length&&t&&!t.some(a,c[s]._)||(c[s]={$:e(),_:t}),c[n.i++].$},_=e=>(t,n)=>{const s=h(),{i:c,s:l,h:u}=s,r=c===l.length;s.i++,r&&(o.has(u)||o.set(u,new Set),l[c]={$:t,_:n,r:null,h:u}),(r||!n||n.some(a,l[c]._))&&e.push(l[c]),l[c].$=t,l[c]._=n},g=_(u),w=_(r),v=(e,t)=>i(t)?t(e):t,E=(e,t,n)=>{const c=h(),{i:o,s:u}=c;o===u.length&&u.push({$:i(n)?n(t):v(void 0,t),set:t=>{u[o].$=e(u[o].$,t),(e=>{s.has(e)||(e.e=1,s.add(e),p.then(l))})(c)}});const{$:r,set:a}=u[c.i++];return[r,a]};
/*! (c) Andrea Giammarchi - ISC */
let k=null,M=null,S=null;const m=new WeakMap,W=new WeakMap,b=(e,t,n,s)=>{const a=a=>{m.has(e)||(m.set(e,0),d.then((()=>{m.delete(e),e.apply(t,n)}))),s(a)};return W.set(s,a),a},C=(e,t,n,s)=>e?[s[0],W.get(s[1])||b(e,t,n,s[1])]:s;return e.createContext=e=>({_:new Set,provide:y,value:e}),e.dropEffect=e=>{const t=o.get(e);t&&d.then((()=>{t.forEach((e=>{e.r(),e.r=null})),t.clear()}))},e.hasEffect=e=>o.has(e),e.hooked=(e,t)=>{const n=p(t?function(){const[t,s,a]=[k,M,S];[k,M,S]=[n,this,arguments];try{return e.apply(M,S)}finally{[k,M,S]=[t,s,a]}}:e);return n},e.useCallback=(e,t)=>g((()=>e),t),e.useContext=({_:e,value:t})=>(e.add(i()),t),e.useEffect=_,e.useLayoutEffect=v,e.useMemo=g,e.useReducer=(e,t,n)=>C(k,M,S,$(e,t,n)),e.useRef=e=>{const t=i(),{i:n,s:s}=t;return n===s.length&&s.push({current:e}),s[t.i++]},e.useState=e=>C(k,M,S,(e=>$(E,e))(e)),e.wait=d,e}({});
let $=null,k=null,S=null;const M=new WeakMap,m=new WeakMap,b=(e,t,n,s)=>{const c=c=>{M.has(e)||(M.set(e,0),p.then((()=>{M.delete(e),e.apply(t,n)}))),s(c)};return m.set(s,c),c},C=(e,t,n,s)=>e?[s[0],m.get(s[1])||b(e,t,n,s[1])]:s;return e.createContext=e=>({_:new Set,provide:d,value:e}),e.dropEffect=e=>{const t=o.get(e);t&&p.then((()=>{t.forEach((e=>{e.r(),e.r=null})),t.clear()}))},e.hasEffect=e=>o.has(e),e.hooked=(e,t)=>{const n=f(t?function(){const[t,s,c]=[$,k,S];[$,k,S]=[n,this,arguments];try{return e.apply(k,S)}finally{[$,k,S]=[t,s,c]}}:e);return n},e.useCallback=(e,t)=>y((()=>e),t),e.useContext=({_:e,value:t})=>(e.add(h()),t),e.useEffect=g,e.useLayoutEffect=w,e.useMemo=y,e.useReducer=(e,t,n)=>C($,k,S,E(e,t,n)),e.useRef=e=>{const t=h(),{i:n,s:s}=t;return n===s.length&&s.push({current:e}),s[t.i++]},e.useState=e=>C($,k,S,(e=>E(v,e))(e)),e.wait=p,e}({});

@@ -22,5 +22,4 @@ self.uhooksFX = (function (exports) {

var h = null,
var info = null,
schedule = new Set();
var hooks = new WeakMap();

@@ -71,3 +70,3 @@ var invoke = function invoke(effect) {

var getInfo = function getInfo() {
return hooks.get(h);
return info;
};

@@ -81,3 +80,3 @@ var hasEffect = function hasEffect(hook) {

var hooked = function hooked(callback) {
var info = {
var current = {
h: hook,

@@ -90,14 +89,13 @@ c: null,

};
hooks.set(hook, info);
return hook;
function hook() {
var p = h;
h = hook;
info.e = info.i = 0;
var prev = info;
info = current;
current.e = current.i = 0;
try {
return callback.apply(info.c = this, info.a = arguments);
return callback.apply(current.c = this, current.a = arguments);
} finally {
h = p;
info = prev;
if (effects.length) wait.then(effects.forEach.bind(effects.splice(0), invoke));

@@ -231,3 +229,3 @@ if (layoutEffects.length) layoutEffects.splice(0).forEach(invoke);

/*! (c) Andrea Giammarchi - ISC */
var h$1 = null,
var h = null,
c = null,

@@ -263,6 +261,6 @@ a = null;

function () {
var ph = h$1,
var ph = h,
pc = c,
pa = a;
h$1 = hook;
h = hook;
c = this;

@@ -277,3 +275,3 @@ a = arguments;

} finally {
h$1 = ph;
h = ph;
c = pc;

@@ -286,6 +284,6 @@ a = pa;

var useReducer$1 = function useReducer$1(reducer, value, init) {
return wrap(h$1, c, a, useReducer(reducer, value, init));
return wrap(h, c, a, useReducer(reducer, value, init));
};
var useState$1 = function useState$1(value) {
return wrap(h$1, c, a, useState(value));
return wrap(h, c, a, useState(value));
};

@@ -292,0 +290,0 @@

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

self.uhooksFX=function(n){"use strict";var t="function"==typeof Promise?Promise:function(n){var t,e=[],u=0;return n((function(n){t=n,u=1,e.splice(0).forEach(r)})),{then:r};function r(n){return u?setTimeout(n,0,t):e.push(n),this}},e=null,u=new Set,r=new WeakMap,i=function(n){var t=n.$,e=n.r,u=n.h;h(e)&&(a.get(u).delete(n),e()),h(n.r=t())&&a.get(u).add(n)},o=function(){var n=u;u=new Set,n.forEach((function(n){var t=n.h,e=n.c,u=n.a;n.e&&t.apply(e,u)}))},a=new WeakMap,c=[],f=[];function s(n,t){return n!==this[t]}var l=function(){return r.get(e)},h=function(n){return"function"==typeof n},v=new t((function(n){return n()}));function p(n){var t=this._;this.value!==n&&(this._=new Set,this.value=n,t.forEach((function(n){var t=n.h,e=n.c,u=n.a;t.apply(e,u)})))}var d=function(n,t){var e=l(),u=e.i,r=e.s;return u!==r.length&&t&&!t.some(s,r[u]._)||(r[u]={$:n(),_:t}),r[e.i++].$},y=function(n){return function(t,e){var u=l(),r=u.i,i=u.s,o=u.h,c=r===i.length;u.i++,c&&(a.has(o)||a.set(o,new Set),i[r]={$:t,_:e,r:null,h:o}),(c||!e||e.some(s,i[r]._))&&n.push(i[r]),i[r].$=t,i[r]._=e}},g=y(c),w=y(f),E=function(n,t){return h(t)?t(n):t},$=function(n,t,e){var r=l(),i=r.i,a=r.s;i===a.length&&a.push({$:h(e)?e(t):E(void 0,t),set:function(t){a[i].$=n(a[i].$,t),function(n){u.has(n)||(n.e=1,u.add(n),v.then(o))}(r)}});var c=a[r.i++];return[c.$,c.set]},_=null,k=null,m=null,S=new WeakMap,M=new WeakMap,W=function(n,t,e,u){var r=function(r){S.has(n)||(S.set(n,0),v.then((function(){S.delete(n),n.apply(t,e)}))),u(r)};return M.set(u,r),r},C=function(n,t,e,u){return n?[u[0],M.get(u[1])||W(n,t,e,u[1])]:u};return n.createContext=function(n){return{_:new Set,provide:p,value:n}},n.dropEffect=function(n){var t=a.get(n);t&&v.then((function(){t.forEach((function(n){n.r(),n.r=null})),t.clear()}))},n.hasEffect=function(n){return a.has(n)},n.hooked=function(n,t){var u=function(n){var t={h:u,c:null,a:null,e:0,i:0,s:[]};return r.set(u,t),u;function u(){var r=e;e=u,t.e=t.i=0;try{return n.apply(t.c=this,t.a=arguments)}finally{e=r,c.length&&v.then(c.forEach.bind(c.splice(0),i)),f.length&&f.splice(0).forEach(i)}}}(t?function(){var t=_,e=k,r=m;_=u,k=this,m=arguments;try{return n.apply(k,m)}finally{_=t,k=e,m=r}}:n);return u},n.useCallback=function(n,t){return d((function(){return n}),t)},n.useContext=function(n){var t=n._,e=n.value;return t.add(l()),e},n.useEffect=g,n.useLayoutEffect=w,n.useMemo=d,n.useReducer=function(n,t,e){return C(_,k,m,$(n,t,e))},n.useRef=function(n){var t=l(),e=t.i,u=t.s;return e===u.length&&u.push({current:n}),u[t.i++]},n.useState=function(n){return C(_,k,m,function(n){return $(E,n)}(n))},n.wait=v,n}({});
self.uhooksFX=function(n){"use strict";var t="function"==typeof Promise?Promise:function(n){var t,e=[],u=0;return n((function(n){t=n,u=1,e.splice(0).forEach(r)})),{then:r};function r(n){return u?setTimeout(n,0,t):e.push(n),this}},e=null,u=new Set,r=function(n){var t=n.$,e=n.r,u=n.h;l(e)&&(o.get(u).delete(n),e()),l(n.r=t())&&o.get(u).add(n)},i=function(){var n=u;u=new Set,n.forEach((function(n){var t=n.h,e=n.c,u=n.a;n.e&&t.apply(e,u)}))},o=new WeakMap,c=[],a=[];function f(n,t){return n!==this[t]}var s=function(){return e},l=function(n){return"function"==typeof n},h=new t((function(n){return n()}));function v(n){var t=this._;this.value!==n&&(this._=new Set,this.value=n,t.forEach((function(n){var t=n.h,e=n.c,u=n.a;t.apply(e,u)})))}var p=function(n,t){var e=s(),u=e.i,r=e.s;return u!==r.length&&t&&!t.some(f,r[u]._)||(r[u]={$:n(),_:t}),r[e.i++].$},d=function(n){return function(t,e){var u=s(),r=u.i,i=u.s,c=u.h,a=r===i.length;u.i++,a&&(o.has(c)||o.set(c,new Set),i[r]={$:t,_:e,r:null,h:c}),(a||!e||e.some(f,i[r]._))&&n.push(i[r]),i[r].$=t,i[r]._=e}},y=d(c),g=d(a),w=function(n,t){return l(t)?t(n):t},E=function(n,t,e){var r=s(),o=r.i,c=r.s;o===c.length&&c.push({$:l(e)?e(t):w(void 0,t),set:function(t){c[o].$=n(c[o].$,t),function(n){u.has(n)||(n.e=1,u.add(n),h.then(i))}(r)}});var a=c[r.i++];return[a.$,a.set]},$=null,_=null,k=null,m=new WeakMap,S=new WeakMap,M=function(n,t,e,u){var r=function(r){m.has(n)||(m.set(n,0),h.then((function(){m.delete(n),n.apply(t,e)}))),u(r)};return S.set(u,r),r},C=function(n,t,e,u){return n?[u[0],S.get(u[1])||M(n,t,e,u[1])]:u};return n.createContext=function(n){return{_:new Set,provide:v,value:n}},n.dropEffect=function(n){var t=o.get(n);t&&h.then((function(){t.forEach((function(n){n.r(),n.r=null})),t.clear()}))},n.hasEffect=function(n){return o.has(n)},n.hooked=function(n,t){var u=function(n){var t={h:u,c:null,a:null,e:0,i:0,s:[]};return u;function u(){var u=e;e=t,t.e=t.i=0;try{return n.apply(t.c=this,t.a=arguments)}finally{e=u,c.length&&h.then(c.forEach.bind(c.splice(0),r)),a.length&&a.splice(0).forEach(r)}}}(t?function(){var t=$,e=_,r=k;$=u,_=this,k=arguments;try{return n.apply(_,k)}finally{$=t,_=e,k=r}}:n);return u},n.useCallback=function(n,t){return p((function(){return n}),t)},n.useContext=function(n){var t=n._,e=n.value;return t.add(s()),e},n.useEffect=y,n.useLayoutEffect=g,n.useMemo=p,n.useReducer=function(n,t,e){return C($,_,k,E(n,t,e))},n.useRef=function(n){var t=s(),e=t.i,u=t.s;return e===u.length&&u.push({current:n}),u[t.i++]},n.useState=function(n){return C($,_,k,function(n){return E(w,n)}(n))},n.wait=h,n}({});
{
"name": "uhooks-fx",
"version": "0.2.1",
"version": "0.2.2",
"description": "uhooks with propagated states",

@@ -33,3 +33,3 @@ "main": "./cjs/index.js",

"ascjs": "^4.0.3",
"rollup": "^2.35.1",
"rollup": "^2.36.0",
"rollup-plugin-includepaths": "^0.2.4",

@@ -54,3 +54,3 @@ "rollup-plugin-terser": "^7.0.2",

"dependencies": {
"uhooks": "^0.2.0"
"uhooks": "^0.2.2"
},

@@ -57,0 +57,0 @@ "repository": {

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