Comparing version 0.4.1 to 0.4.2
@@ -1,2 +0,2 @@ | ||
import n,{useContext as t,useState as e,useEffect as r}from"react";function o(e){const r=n.createContext({});return{EnsureWrapper:t=>{let[o,c]=e();return o&&null==c?n.createElement(r.Provider,{value:o},t.children):t.fallback?t.fallback:null},contextHook:function(){return t(r)}}}function c(n,t,o){const[c,u]=e(void 0),[i,a]=e(void 0);return r(()=>t((n,t)=>{n&&(a(n),u(null)),u(t)}),[t]),r(()=>{try{n().then(n=>{u(n)}).catch(n=>{a(n)})}catch(n){a(n)}},[]),[c,i,o]}function u(n,t,e){Object.defineProperty(n,t,{get:()=>e(),enumerable:!0})}function i(n){return{useContainer:function(){return function(n){let t={},e=n.getTokens();for(let r in e)u(t,r,()=>c(()=>n.containers[r],t=>n.subscribeToContiner(r,t),r));return t}(t(n))},useContainerSet:function(o){const[c,u]=e(void 0),[i,a]=e(void 0),l=t(n),f="function"==typeof o?l._extractTokens(o):o;return r(()=>{l.getContainerSet(f).then(n=>{u(n)})},f),r(()=>{const n=l.subscribeToContinerSet(f,(n,t)=>{n?a(n):u(t)});return n},f),[c,i]}}}export{o as generateEnsureContainerSet,i as getContainerSetHooks}; | ||
import n,{useContext as t,useState as e,useEffect as r}from"react";function o(e){const r=n.createContext({});return{EnsureWrapper:t=>{let[o,c]=e();return o&&null==c?n.createElement(r.Provider,{value:o},t.children):t.fallback?t.fallback:null},contextHook:function(){return t(r)}}}function c(n,t,o){const[c,i]=e(void 0),[u,a]=e(void 0);return r(()=>t((n,t)=>{n&&(a(n),i(null)),i(t)}),[t]),r(()=>{try{const t=n();t instanceof Promise?t.then(n=>{i(n)}).catch(n=>{a(n)}):i(t)}catch(n){a(n)}},[]),[c,u,o]}function i(n,t,e){Object.defineProperty(n,t,{get:()=>e(),enumerable:!0})}function u(n){return{useContainer:function(){return function(n){let t={},e=n.getTokens();for(let r in e)i(t,r,()=>c(()=>n.containers[r],t=>n.subscribeToContiner(r,t),r));return t}(t(n))},useContainerSet:function(o){const[c,i]=e(void 0),[u,a]=e(void 0),l=t(n),s="function"==typeof o?l._extractTokens(o):o;return r(()=>{l.getContainerSet(s).then(n=>{i(n)})},s),r(()=>{const n=l.subscribeToContinerSet(s,(n,t)=>{n?a(n):i(t)});return n},s),[c,u]}}}export{o as generateEnsureContainerSet,u as getContainerSetHooks}; | ||
//# sourceMappingURL=iti-react.modern.js.map |
@@ -1,2 +0,2 @@ | ||
import n,{useContext as t,useState as r,useEffect as e}from"react";function o(r){var e=n.createContext({});return{EnsureWrapper:function(t){var o=r(),u=o[0];return u&&null==o[1]?n.createElement(e.Provider,{value:u},t.children):t.fallback?t.fallback:null},contextHook:function(){return t(e)}}}function u(n){return{useContainer:function(){return function(n){var t={},o=n.getTokens(),u=function(o){var u;u=function(){return t=function(){return n.containers[o]},u=function(t){return n.subscribeToContiner(o,t)},i=o,f=(c=r(void 0))[0],a=c[1],v=(l=r(void 0))[0],s=l[1],e(function(){return u(function(n,t){n&&(s(n),a(null)),a(t)})},[u]),e(function(){try{t().then(function(n){a(n)}).catch(function(n){s(n)})}catch(n){s(n)}},[]),[f,v,i];var t,u,i,c,f,a,l,v,s},Object.defineProperty(t,o,{get:function(){return u()},enumerable:!0})};for(var i in o)u(i);return t}(t(n))},useContainerSet:function(o){var u=r(void 0),i=u[0],c=u[1],f=r(void 0),a=f[0],l=f[1],v=t(n),s="function"==typeof o?v._extractTokens(o):o;return e(function(){v.getContainerSet(s).then(function(n){c(n)})},s),e(function(){var n=v.subscribeToContinerSet(s,function(n,t){n?l(n):c(t)});return n},s),[i,a]}}}export{o as generateEnsureContainerSet,u as getContainerSetHooks}; | ||
import n,{useContext as t,useState as r,useEffect as e}from"react";function o(r){var e=n.createContext({});return{EnsureWrapper:function(t){var o=r(),u=o[0];return u&&null==o[1]?n.createElement(e.Provider,{value:u},t.children):t.fallback?t.fallback:null},contextHook:function(){return t(e)}}}function u(n){return{useContainer:function(){return function(n){var t={},o=n.getTokens(),u=function(o){var u;u=function(){return t=function(){return n.containers[o]},u=function(t){return n.subscribeToContiner(o,t)},i=o,f=(c=r(void 0))[0],a=c[1],l=(v=r(void 0))[0],s=v[1],e(function(){return u(function(n,t){n&&(s(n),a(null)),a(t)})},[u]),e(function(){try{var n=t();n instanceof Promise?n.then(function(n){a(n)}).catch(function(n){s(n)}):a(n)}catch(n){s(n)}},[]),[f,l,i];var t,u,i,c,f,a,v,l,s},Object.defineProperty(t,o,{get:function(){return u()},enumerable:!0})};for(var i in o)u(i);return t}(t(n))},useContainerSet:function(o){var u=r(void 0),i=u[0],c=u[1],f=r(void 0),a=f[0],v=f[1],l=t(n),s="function"==typeof o?l._extractTokens(o):o;return e(function(){l.getContainerSet(s).then(function(n){c(n)})},s),e(function(){var n=l.subscribeToContinerSet(s,function(n,t){n?v(n):c(t)});return n},s),[i,a]}}}export{o as generateEnsureContainerSet,u as getContainerSetHooks}; | ||
//# sourceMappingURL=iti-react.module.js.map |
{ | ||
"name": "iti-react", | ||
"version": "0.4.1", | ||
"description": "Handy React bindings for iti", | ||
"version": "0.4.2", | ||
"description": "Handy React bindings for iti, a ~1kB Typesafe dependency injection framework for TypeScript and JavaScript with a unique support for async flow", | ||
"type": "module", | ||
@@ -24,2 +24,3 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"iti": "0.4.2", | ||
"utility-types": "^3.10.0" | ||
@@ -30,3 +31,2 @@ }, | ||
"install-peers-cli": "^2.2.0", | ||
"iti": "0.4.1", | ||
"microbundle": "^0.15.0", | ||
@@ -39,3 +39,3 @@ "nodemon": "^2.0.19", | ||
"react": ">=16", | ||
"react-dom": "^17.0.2" | ||
"react-dom": ">=17.0.2" | ||
}, | ||
@@ -42,0 +42,0 @@ "repository": "https://github.com/molszanski/iti", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47060
6
26
166
4
3
+ Addediti@0.4.2
+ Addediti@0.4.2(transitive)
+ Addedreact-dom@18.3.1(transitive)
+ Addedscheduler@0.23.2(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedreact@17.0.2(transitive)
- Removedreact-dom@17.0.2(transitive)
- Removedscheduler@0.20.2(transitive)