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

reactive-di

Package Overview
Dependencies
Maintainers
1
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reactive-di - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

5

CHANGELOG.md

@@ -5,2 +5,7 @@ # Change Log

<a name="4.0.2"></a>
## [4.0.2](https://github.com/zerkalica/reactive-di/compare/v4.0.1...v4.0.2) (2017-08-03)
<a name="4.0.1"></a>

@@ -7,0 +12,0 @@ ## [4.0.1](https://github.com/zerkalica/reactive-di/compare/v4.0.0...v4.0.1) (2017-08-03)

2

dist/reactive-di.es.js

@@ -154,3 +154,3 @@ import { defaultContext, detached, memkey } from 'lom_atom';

Injector.prototype._destroyProp = function _destroyProp(key, value) {
if (typeof key === 'function' && key.theme !== undefined && value !== undefined) {
if (this === this.top && typeof key === 'function' && key.theme !== undefined && value !== undefined) {
value.detach();

@@ -157,0 +157,0 @@ return;

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

"use strict";function _applyDecoratedDescriptor$1(t,e,r,o,n){var i={};return Object.keys(o).forEach(function(t){i[t]=o[t]}),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=r.slice().reverse().reduce(function(r,o){return o(t,e,r)||r},i),n&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(n):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(t,e,i),i=null),i}function _applyDecoratedDescriptor(t,e,r,o,n){var i={};return Object.keys(o).forEach(function(t){i[t]=o[t]}),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=r.slice().reverse().reduce(function(r,o){return o(t,e,r)||r},i),n&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(n):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(t,e,i),i=null),i}function createEventFix(t){function e(e){t(e),lom_atom.defaultContext.run()}return e.displayName=t.displayName||t.name,e}function shouldUpdate(t,e){if(t===e)return!1;if(!t&&e||!e&&t)return!0;var r=0;for(var o in t){if(t[o]!==e[o])return!0;r++}for(var n in e)r--;return 0!==r}function createCreateElement(t,e){return function(){var r=arguments[0],o=arguments[1],n=void 0,i="function"==typeof r&&void 0===r.prototype.render;switch(i?(void 0===r.__lom&&(r.__lom=t(r)),n=r.__lom,o?o.__lom_ctx=parentContext:o={__lom_ctx:parentContext}):n=r,o&&(o.onKeyPress&&(o.onKeyPress=createEventFix(o.onKeyPress)),o.onKeyDown&&(o.onKeyDown=createEventFix(o.onKeyDown)),o.onKeyUp&&(o.onKeyUp=createEventFix(o.onKeyUp)),o.onInput&&(o.onChange=createEventFix(o.onInput)),o.onChange&&(o.onChange=createEventFix(o.onChange))),arguments.length){case 2:return e(n,o);case 3:return e(n,o,arguments[2]);case 4:return e(n,o,arguments[2],arguments[3]);case 5:return e(n,o,arguments[2],arguments[3],arguments[4]);case 6:return e(n,o,arguments[2],arguments[3],arguments[4],arguments[5]);case 7:return e(n,o,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]);case 8:return e(n,o,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7]);case 9:return e(n,o,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8]);default:if(!1===i)return e.apply(null,arguments);for(var s=[n,o],a=2,c=arguments.length;a<c;a++)s.push(arguments[a]);return e.apply(null,s)}}}function createReactWrapper(t,e){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Injector,n=(r=function(t){function r(e,r,o){var n;return n=t.call(this,e,r)||this,n._propsChanged=!0,n._injector=void 0,n._el=void 0,n._render=o,void 0===o.deps&&void 0===o.props||n.constructor.instances++,n}return inheritsLoose(r,t),r.prototype.shouldComponentUpdate=function(t){return this._propsChanged=shouldUpdate(this.props,t),this._propsChanged},r.prototype.componentWillUnmount=function(){lom_atom.defaultContext.getAtom("r$",this).destroyed(!0)},r.prototype._destroy=function(){var t=this._render;void 0===t.deps&&void 0===t.props||this.constructor.instances--,this._el=void 0,this.props=void 0,this._injector=void 0,this._render=void 0},r.prototype._getInjector=function(){var t=this.props.__lom_ctx||o;return this._injector=this.constructor.instances>0?t.copy():t,this._injector},r.prototype._state=function(t,e){var r=this._injector||this._getInjector();return this._render.props&&e&&r.value(this._render.props,this.props,!0),r.resolve(this._render.deps)[0]},r.prototype.r=function(t,r){var o=void 0,n=this._render,i=parentContext;parentContext=this._injector||this._getInjector();var s=void 0!==n.deps?this._state(void 0,r):void 0;try{o=n(this.props,s)}catch(t){var a=n.onError||e;o=a({error:t},void 0===a.deps?void 0:parentContext.resolve(a.deps)[0])}return parentContext=i,r||(this._el=o,this.forceUpdate(),this._el=void 0),this._propsChanged=!1,o},r.prototype.render=function(){return void 0===this._el?this.r(void 0,this._propsChanged):this._el},r}(t),_applyDecoratedDescriptor(r.prototype,"r",[lom_atom.detached],Object.getOwnPropertyDescriptor(r.prototype,"r"),r.prototype),r);return function(t){function e(e,r){n.call(this,e,r,t)}return e.instances=0,e.displayName=t.displayName||t.name,e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e}}Object.defineProperty(exports,"__esModule",{value:!0});var lom_atom=require("lom_atom"),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},inheritsLoose=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e},_class2,chainCount=0,FakeSheet=function(){function t(){this.classes={}}return t.prototype.update=function(t){return this},t.prototype.attach=function(){return this},t.prototype.detach=function(){return this},t}(),defaultSheetProcessor={createStyleSheet:function(t){return new FakeSheet}},Injector=(_class2=function(){function t(t,e,r){if(this.parent=r,this.top=r?r.top:this,this._sheetProcessor=e||defaultSheetProcessor,this._sticky=void 0,void 0!==t)for(var o=0;o<t.length;o++){var n=t[o];n instanceof Array?this.value(n[0],n[1],!0):"function"==typeof n?(void 0===this._sticky&&(this._sticky=new Set),this._sticky.add(n)):this.value(n.constructor,n,!0)}}return t.prototype.value=function(t,e,r,o){if(void 0!==e)return e;if(!0===t.theme){if(this.top===this){var n=void 0===o?this._sheetProcessor.createStyleSheet(this._fastCall(t)):o.update(this._fastCall(t));return n.attach(),n}return this.top.value(t)}if(void 0!==this.parent&&(void 0===this._sticky||!this._sticky.has(t))){chainCount++;var i=this.parent.value(t);if(chainCount--,void 0!==i)return i}return 0===chainCount?this._fastNew(t):void 0},t.prototype._destroyProp=function(t,e){"function"!=typeof t||void 0===t.theme||void 0===e||e.detach()},t.prototype._destroy=function(){this._sticky=void 0,this.parent=void 0,this.top=void 0,this._sheetProcessor=void 0},t.prototype._fastNew=function(t){var e=this.resolve(t.deps);switch(e.length){case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);default:return new(Function.prototype.bind.apply(t,[null].concat(e)))}},t.prototype._fastCall=function(t){var e=this.resolve(t.deps);switch(e.length){case 1:return t(e[0]);case 2:return t(e[0],e[1]);case 3:return t(e[0],e[1],e[2]);case 4:return t(e[0],e[1],e[2],e[3]);case 5:return t(e[0],e[1],e[2],e[3],e[4]);case 6:return t(e[0],e[1],e[2],e[3],e[4],e[5]);default:return t.apply(void 0,e)}},t.prototype.copy=function(e){return new t(e,this._sheetProcessor,this)},t.prototype.resolve=function(t){var e=[];if(void 0!==t)for(var r=0,o=t.length;r<o;r++){var n=t[r];if("object"===_typeof(n)){var i={};for(var s in n){var a=n[s];i[s]=void 0===a.theme?this.value(a):this.value(a).classes}e.push(i)}else e.push(this.value(n))}return e},t}(),_applyDecoratedDescriptor$1(_class2.prototype,"value",[lom_atom.memkey],Object.getOwnPropertyDescriptor(_class2.prototype,"value"),_class2.prototype),_class2),parentContext=void 0;exports.createReactWrapper=createReactWrapper,exports.createCreateElement=createCreateElement,exports.Injector=Injector;
"use strict";function _applyDecoratedDescriptor$1(t,e,r,o,n){var i={};return Object.keys(o).forEach(function(t){i[t]=o[t]}),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=r.slice().reverse().reduce(function(r,o){return o(t,e,r)||r},i),n&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(n):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(t,e,i),i=null),i}function _applyDecoratedDescriptor(t,e,r,o,n){var i={};return Object.keys(o).forEach(function(t){i[t]=o[t]}),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=r.slice().reverse().reduce(function(r,o){return o(t,e,r)||r},i),n&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(n):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(t,e,i),i=null),i}function createEventFix(t){function e(e){t(e),lom_atom.defaultContext.run()}return e.displayName=t.displayName||t.name,e}function shouldUpdate(t,e){if(t===e)return!1;if(!t&&e||!e&&t)return!0;var r=0;for(var o in t){if(t[o]!==e[o])return!0;r++}for(var n in e)r--;return 0!==r}function createCreateElement(t,e){return function(){var r=arguments[0],o=arguments[1],n=void 0,i="function"==typeof r&&void 0===r.prototype.render;switch(i?(void 0===r.__lom&&(r.__lom=t(r)),n=r.__lom,o?o.__lom_ctx=parentContext:o={__lom_ctx:parentContext}):n=r,o&&(o.onKeyPress&&(o.onKeyPress=createEventFix(o.onKeyPress)),o.onKeyDown&&(o.onKeyDown=createEventFix(o.onKeyDown)),o.onKeyUp&&(o.onKeyUp=createEventFix(o.onKeyUp)),o.onInput&&(o.onChange=createEventFix(o.onInput)),o.onChange&&(o.onChange=createEventFix(o.onChange))),arguments.length){case 2:return e(n,o);case 3:return e(n,o,arguments[2]);case 4:return e(n,o,arguments[2],arguments[3]);case 5:return e(n,o,arguments[2],arguments[3],arguments[4]);case 6:return e(n,o,arguments[2],arguments[3],arguments[4],arguments[5]);case 7:return e(n,o,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]);case 8:return e(n,o,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7]);case 9:return e(n,o,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8]);default:if(!1===i)return e.apply(null,arguments);for(var s=[n,o],a=2,c=arguments.length;a<c;a++)s.push(arguments[a]);return e.apply(null,s)}}}function createReactWrapper(t,e){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Injector,n=(r=function(t){function r(e,r,o){var n;return n=t.call(this,e,r)||this,n._propsChanged=!0,n._injector=void 0,n._el=void 0,n._render=o,void 0===o.deps&&void 0===o.props||n.constructor.instances++,n}return inheritsLoose(r,t),r.prototype.shouldComponentUpdate=function(t){return this._propsChanged=shouldUpdate(this.props,t),this._propsChanged},r.prototype.componentWillUnmount=function(){lom_atom.defaultContext.getAtom("r$",this).destroyed(!0)},r.prototype._destroy=function(){var t=this._render;void 0===t.deps&&void 0===t.props||this.constructor.instances--,this._el=void 0,this.props=void 0,this._injector=void 0,this._render=void 0},r.prototype._getInjector=function(){var t=this.props.__lom_ctx||o;return this._injector=this.constructor.instances>0?t.copy():t,this._injector},r.prototype._state=function(t,e){var r=this._injector||this._getInjector();return this._render.props&&e&&r.value(this._render.props,this.props,!0),r.resolve(this._render.deps)[0]},r.prototype.r=function(t,r){var o=void 0,n=this._render,i=parentContext;parentContext=this._injector||this._getInjector();var s=void 0!==n.deps?this._state(void 0,r):void 0;try{o=n(this.props,s)}catch(t){var a=n.onError||e;o=a({error:t},void 0===a.deps?void 0:parentContext.resolve(a.deps)[0])}return parentContext=i,r||(this._el=o,this.forceUpdate(),this._el=void 0),this._propsChanged=!1,o},r.prototype.render=function(){return void 0===this._el?this.r(void 0,this._propsChanged):this._el},r}(t),_applyDecoratedDescriptor(r.prototype,"r",[lom_atom.detached],Object.getOwnPropertyDescriptor(r.prototype,"r"),r.prototype),r);return function(t){function e(e,r){n.call(this,e,r,t)}return e.instances=0,e.displayName=t.displayName||t.name,e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e}}Object.defineProperty(exports,"__esModule",{value:!0});var lom_atom=require("lom_atom"),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},inheritsLoose=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e},_class2,chainCount=0,FakeSheet=function(){function t(){this.classes={}}return t.prototype.update=function(t){return this},t.prototype.attach=function(){return this},t.prototype.detach=function(){return this},t}(),defaultSheetProcessor={createStyleSheet:function(t){return new FakeSheet}},Injector=(_class2=function(){function t(t,e,r){if(this.parent=r,this.top=r?r.top:this,this._sheetProcessor=e||defaultSheetProcessor,this._sticky=void 0,void 0!==t)for(var o=0;o<t.length;o++){var n=t[o];n instanceof Array?this.value(n[0],n[1],!0):"function"==typeof n?(void 0===this._sticky&&(this._sticky=new Set),this._sticky.add(n)):this.value(n.constructor,n,!0)}}return t.prototype.value=function(t,e,r,o){if(void 0!==e)return e;if(!0===t.theme){if(this.top===this){var n=void 0===o?this._sheetProcessor.createStyleSheet(this._fastCall(t)):o.update(this._fastCall(t));return n.attach(),n}return this.top.value(t)}if(void 0!==this.parent&&(void 0===this._sticky||!this._sticky.has(t))){chainCount++;var i=this.parent.value(t);if(chainCount--,void 0!==i)return i}return 0===chainCount?this._fastNew(t):void 0},t.prototype._destroyProp=function(t,e){this!==this.top||"function"!=typeof t||void 0===t.theme||void 0===e||e.detach()},t.prototype._destroy=function(){this._sticky=void 0,this.parent=void 0,this.top=void 0,this._sheetProcessor=void 0},t.prototype._fastNew=function(t){var e=this.resolve(t.deps);switch(e.length){case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);default:return new(Function.prototype.bind.apply(t,[null].concat(e)))}},t.prototype._fastCall=function(t){var e=this.resolve(t.deps);switch(e.length){case 1:return t(e[0]);case 2:return t(e[0],e[1]);case 3:return t(e[0],e[1],e[2]);case 4:return t(e[0],e[1],e[2],e[3]);case 5:return t(e[0],e[1],e[2],e[3],e[4]);case 6:return t(e[0],e[1],e[2],e[3],e[4],e[5]);default:return t.apply(void 0,e)}},t.prototype.copy=function(e){return new t(e,this._sheetProcessor,this)},t.prototype.resolve=function(t){var e=[];if(void 0!==t)for(var r=0,o=t.length;r<o;r++){var n=t[r];if("object"===_typeof(n)){var i={};for(var s in n){var a=n[s];i[s]=void 0===a.theme?this.value(a):this.value(a).classes}e.push(i)}else e.push(this.value(n))}return e},t}(),_applyDecoratedDescriptor$1(_class2.prototype,"value",[lom_atom.memkey],Object.getOwnPropertyDescriptor(_class2.prototype,"value"),_class2.prototype),_class2),parentContext=void 0;exports.createReactWrapper=createReactWrapper,exports.createCreateElement=createCreateElement,exports.Injector=Injector;
//# sourceMappingURL=reactive-di.js.map

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("lom_atom")):"function"==typeof define&&define.amd?define(["exports","lom_atom"],e):e(t["reactive-di"]={},t.lom_atom)}(this,function(t,e){"use strict";function r(t,e,r,o,n){var i={};return Object.keys(o).forEach(function(t){i[t]=o[t]}),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=r.slice().reverse().reduce(function(r,o){return o(t,e,r)||r},i),n&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(n):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(t,e,i),i=null),i}function o(t){function r(r){t(r),e.defaultContext.run()}return r.displayName=t.displayName||t.name,r}function n(t,e){if(t===e)return!1;if(!t&&e||!e&&t)return!0;var r=0;for(var o in t){if(t[o]!==e[o])return!0;r++}for(var n in e)r--;return 0!==r}var i,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e},c=0,u=function(){function t(){this.classes={}}return t.prototype.update=function(t){return this},t.prototype.attach=function(){return this},t.prototype.detach=function(){return this},t}(),p={createStyleSheet:function(t){return new u}},l=(i=function(){function t(t,e,r){if(this.parent=r,this.top=r?r.top:this,this._sheetProcessor=e||p,this._sticky=void 0,void 0!==t)for(var o=0;o<t.length;o++){var n=t[o];n instanceof Array?this.value(n[0],n[1],!0):"function"==typeof n?(void 0===this._sticky&&(this._sticky=new Set),this._sticky.add(n)):this.value(n.constructor,n,!0)}}return t.prototype.value=function(t,e,r,o){if(void 0!==e)return e;if(!0===t.theme){if(this.top===this){var n=void 0===o?this._sheetProcessor.createStyleSheet(this._fastCall(t)):o.update(this._fastCall(t));return n.attach(),n}return this.top.value(t)}if(void 0!==this.parent&&(void 0===this._sticky||!this._sticky.has(t))){c++;var i=this.parent.value(t);if(c--,void 0!==i)return i}return 0===c?this._fastNew(t):void 0},t.prototype._destroyProp=function(t,e){"function"!=typeof t||void 0===t.theme||void 0===e||e.detach()},t.prototype._destroy=function(){this._sticky=void 0,this.parent=void 0,this.top=void 0,this._sheetProcessor=void 0},t.prototype._fastNew=function(t){var e=this.resolve(t.deps);switch(e.length){case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);default:return new(Function.prototype.bind.apply(t,[null].concat(e)))}},t.prototype._fastCall=function(t){var e=this.resolve(t.deps);switch(e.length){case 1:return t(e[0]);case 2:return t(e[0],e[1]);case 3:return t(e[0],e[1],e[2]);case 4:return t(e[0],e[1],e[2],e[3]);case 5:return t(e[0],e[1],e[2],e[3],e[4]);case 6:return t(e[0],e[1],e[2],e[3],e[4],e[5]);default:return t.apply(void 0,e)}},t.prototype.copy=function(e){return new t(e,this._sheetProcessor,this)},t.prototype.resolve=function(t){var e=[];if(void 0!==t)for(var r=0,o=t.length;r<o;r++){var n=t[r];if("object"===s(n)){var i={};for(var a in n){var c=n[a];i[a]=void 0===c.theme?this.value(c):this.value(c).classes}e.push(i)}else e.push(this.value(n))}return e},t}(),function(t,e,r,o,n){var i={};Object.keys(o).forEach(function(t){i[t]=o[t]}),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=r.slice().reverse().reduce(function(r,o){return o(t,e,r)||r},i),n&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(n):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(t,e,i),i=null)}(i.prototype,"value",[e.memkey],Object.getOwnPropertyDescriptor(i.prototype,"value"),i.prototype),i),h=void 0;t.createReactWrapper=function(t,o){var i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new l,c=(i=function(t){function r(e,r,o){var n;return n=t.call(this,e,r)||this,n._propsChanged=!0,n._injector=void 0,n._el=void 0,n._render=o,void 0===o.deps&&void 0===o.props||n.constructor.instances++,n}return a(r,t),r.prototype.shouldComponentUpdate=function(t){return this._propsChanged=n(this.props,t),this._propsChanged},r.prototype.componentWillUnmount=function(){e.defaultContext.getAtom("r$",this).destroyed(!0)},r.prototype._destroy=function(){var t=this._render;void 0===t.deps&&void 0===t.props||this.constructor.instances--,this._el=void 0,this.props=void 0,this._injector=void 0,this._render=void 0},r.prototype._getInjector=function(){var t=this.props.__lom_ctx||s;return this._injector=this.constructor.instances>0?t.copy():t,this._injector},r.prototype._state=function(t,e){var r=this._injector||this._getInjector();return this._render.props&&e&&r.value(this._render.props,this.props,!0),r.resolve(this._render.deps)[0]},r.prototype.r=function(t,e){var r=void 0,n=this._render,i=h;h=this._injector||this._getInjector();var s=void 0!==n.deps?this._state(void 0,e):void 0;try{r=n(this.props,s)}catch(t){var a=n.onError||o;r=a({error:t},void 0===a.deps?void 0:h.resolve(a.deps)[0])}return h=i,e||(this._el=r,this.forceUpdate(),this._el=void 0),this._propsChanged=!1,r},r.prototype.render=function(){return void 0===this._el?this.r(void 0,this._propsChanged):this._el},r}(t),r(i.prototype,"r",[e.detached],Object.getOwnPropertyDescriptor(i.prototype,"r"),i.prototype),i);return function(t){function e(e,r){c.call(this,e,r,t)}return e.instances=0,e.displayName=t.displayName||t.name,e.prototype=Object.create(c.prototype),e.prototype.constructor=e,e}},t.createCreateElement=function(t,e){return function(){var r=arguments[0],n=arguments[1],i=void 0,s="function"==typeof r&&void 0===r.prototype.render;switch(s?(void 0===r.__lom&&(r.__lom=t(r)),i=r.__lom,n?n.__lom_ctx=h:n={__lom_ctx:h}):i=r,n&&(n.onKeyPress&&(n.onKeyPress=o(n.onKeyPress)),n.onKeyDown&&(n.onKeyDown=o(n.onKeyDown)),n.onKeyUp&&(n.onKeyUp=o(n.onKeyUp)),n.onInput&&(n.onChange=o(n.onInput)),n.onChange&&(n.onChange=o(n.onChange))),arguments.length){case 2:return e(i,n);case 3:return e(i,n,arguments[2]);case 4:return e(i,n,arguments[2],arguments[3]);case 5:return e(i,n,arguments[2],arguments[3],arguments[4]);case 6:return e(i,n,arguments[2],arguments[3],arguments[4],arguments[5]);case 7:return e(i,n,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]);case 8:return e(i,n,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7]);case 9:return e(i,n,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8]);default:if(!1===s)return e.apply(null,arguments);for(var a=[i,n],c=2,u=arguments.length;c<u;c++)a.push(arguments[c]);return e.apply(null,a)}}},t.Injector=l,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("lom_atom")):"function"==typeof define&&define.amd?define(["exports","lom_atom"],e):e(t["reactive-di"]={},t.lom_atom)}(this,function(t,e){"use strict";function r(t,e,r,o,n){var i={};return Object.keys(o).forEach(function(t){i[t]=o[t]}),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=r.slice().reverse().reduce(function(r,o){return o(t,e,r)||r},i),n&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(n):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(t,e,i),i=null),i}function o(t){function r(r){t(r),e.defaultContext.run()}return r.displayName=t.displayName||t.name,r}function n(t,e){if(t===e)return!1;if(!t&&e||!e&&t)return!0;var r=0;for(var o in t){if(t[o]!==e[o])return!0;r++}for(var n in e)r--;return 0!==r}var i,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e},c=0,u=function(){function t(){this.classes={}}return t.prototype.update=function(t){return this},t.prototype.attach=function(){return this},t.prototype.detach=function(){return this},t}(),p={createStyleSheet:function(t){return new u}},l=(i=function(){function t(t,e,r){if(this.parent=r,this.top=r?r.top:this,this._sheetProcessor=e||p,this._sticky=void 0,void 0!==t)for(var o=0;o<t.length;o++){var n=t[o];n instanceof Array?this.value(n[0],n[1],!0):"function"==typeof n?(void 0===this._sticky&&(this._sticky=new Set),this._sticky.add(n)):this.value(n.constructor,n,!0)}}return t.prototype.value=function(t,e,r,o){if(void 0!==e)return e;if(!0===t.theme){if(this.top===this){var n=void 0===o?this._sheetProcessor.createStyleSheet(this._fastCall(t)):o.update(this._fastCall(t));return n.attach(),n}return this.top.value(t)}if(void 0!==this.parent&&(void 0===this._sticky||!this._sticky.has(t))){c++;var i=this.parent.value(t);if(c--,void 0!==i)return i}return 0===c?this._fastNew(t):void 0},t.prototype._destroyProp=function(t,e){this!==this.top||"function"!=typeof t||void 0===t.theme||void 0===e||e.detach()},t.prototype._destroy=function(){this._sticky=void 0,this.parent=void 0,this.top=void 0,this._sheetProcessor=void 0},t.prototype._fastNew=function(t){var e=this.resolve(t.deps);switch(e.length){case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);default:return new(Function.prototype.bind.apply(t,[null].concat(e)))}},t.prototype._fastCall=function(t){var e=this.resolve(t.deps);switch(e.length){case 1:return t(e[0]);case 2:return t(e[0],e[1]);case 3:return t(e[0],e[1],e[2]);case 4:return t(e[0],e[1],e[2],e[3]);case 5:return t(e[0],e[1],e[2],e[3],e[4]);case 6:return t(e[0],e[1],e[2],e[3],e[4],e[5]);default:return t.apply(void 0,e)}},t.prototype.copy=function(e){return new t(e,this._sheetProcessor,this)},t.prototype.resolve=function(t){var e=[];if(void 0!==t)for(var r=0,o=t.length;r<o;r++){var n=t[r];if("object"===s(n)){var i={};for(var a in n){var c=n[a];i[a]=void 0===c.theme?this.value(c):this.value(c).classes}e.push(i)}else e.push(this.value(n))}return e},t}(),function(t,e,r,o,n){var i={};Object.keys(o).forEach(function(t){i[t]=o[t]}),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=r.slice().reverse().reduce(function(r,o){return o(t,e,r)||r},i),n&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(n):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(t,e,i),i=null)}(i.prototype,"value",[e.memkey],Object.getOwnPropertyDescriptor(i.prototype,"value"),i.prototype),i),h=void 0;t.createReactWrapper=function(t,o){var i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new l,c=(i=function(t){function r(e,r,o){var n;return n=t.call(this,e,r)||this,n._propsChanged=!0,n._injector=void 0,n._el=void 0,n._render=o,void 0===o.deps&&void 0===o.props||n.constructor.instances++,n}return a(r,t),r.prototype.shouldComponentUpdate=function(t){return this._propsChanged=n(this.props,t),this._propsChanged},r.prototype.componentWillUnmount=function(){e.defaultContext.getAtom("r$",this).destroyed(!0)},r.prototype._destroy=function(){var t=this._render;void 0===t.deps&&void 0===t.props||this.constructor.instances--,this._el=void 0,this.props=void 0,this._injector=void 0,this._render=void 0},r.prototype._getInjector=function(){var t=this.props.__lom_ctx||s;return this._injector=this.constructor.instances>0?t.copy():t,this._injector},r.prototype._state=function(t,e){var r=this._injector||this._getInjector();return this._render.props&&e&&r.value(this._render.props,this.props,!0),r.resolve(this._render.deps)[0]},r.prototype.r=function(t,e){var r=void 0,n=this._render,i=h;h=this._injector||this._getInjector();var s=void 0!==n.deps?this._state(void 0,e):void 0;try{r=n(this.props,s)}catch(t){var a=n.onError||o;r=a({error:t},void 0===a.deps?void 0:h.resolve(a.deps)[0])}return h=i,e||(this._el=r,this.forceUpdate(),this._el=void 0),this._propsChanged=!1,r},r.prototype.render=function(){return void 0===this._el?this.r(void 0,this._propsChanged):this._el},r}(t),r(i.prototype,"r",[e.detached],Object.getOwnPropertyDescriptor(i.prototype,"r"),i.prototype),i);return function(t){function e(e,r){c.call(this,e,r,t)}return e.instances=0,e.displayName=t.displayName||t.name,e.prototype=Object.create(c.prototype),e.prototype.constructor=e,e}},t.createCreateElement=function(t,e){return function(){var r=arguments[0],n=arguments[1],i=void 0,s="function"==typeof r&&void 0===r.prototype.render;switch(s?(void 0===r.__lom&&(r.__lom=t(r)),i=r.__lom,n?n.__lom_ctx=h:n={__lom_ctx:h}):i=r,n&&(n.onKeyPress&&(n.onKeyPress=o(n.onKeyPress)),n.onKeyDown&&(n.onKeyDown=o(n.onKeyDown)),n.onKeyUp&&(n.onKeyUp=o(n.onKeyUp)),n.onInput&&(n.onChange=o(n.onInput)),n.onChange&&(n.onChange=o(n.onChange))),arguments.length){case 2:return e(i,n);case 3:return e(i,n,arguments[2]);case 4:return e(i,n,arguments[2],arguments[3]);case 5:return e(i,n,arguments[2],arguments[3],arguments[4]);case 6:return e(i,n,arguments[2],arguments[3],arguments[4],arguments[5]);case 7:return e(i,n,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]);case 8:return e(i,n,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7]);case 9:return e(i,n,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8]);default:if(!1===s)return e.apply(null,arguments);for(var a=[i,n],c=2,u=arguments.length;c<u;c++)a.push(arguments[c]);return e.apply(null,a)}}},t.Injector=l,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=reactive-di.umd.js.map
{
"name": "reactive-di",
"version": "4.0.1",
"version": "4.0.2",
"description": "Reactive dependency injection",

@@ -22,3 +22,3 @@ "publishConfig": {

"test.dev": "mocha --growl --watch",
"watch": "chokidar --initial -d 2000 -t 1000 'src/**/*.js' -c 'npm run build && cp -rvf *.js src dist $npm_package_config_dest/node_modules/reactive-di'"
"watch": "chokidar --initial -d 2000 -t 1000 'src/**/*.js' -c 'npm run build && cp -rvf *.js src dist ../rdi-examples/node_modules/reactive-di'"
},

@@ -25,0 +25,0 @@ "author": "Stefan Zerkalica <zerkalica@gmail.com>",

// @flow
import {mem, memkey} from 'lom_atom'
import {memkey} from 'lom_atom'

@@ -107,3 +107,3 @@ export type IArg = Function | {+[id: string]: Function}

_destroyProp(key?: string | Function, value?: mixed) {
if (typeof key === 'function' && key.theme !== undefined && value !== undefined) {
if (this === this.top && typeof key === 'function' && key.theme !== undefined && value !== undefined) {
(value: any).detach()

@@ -110,0 +110,0 @@ return

Sorry, the diff of this file is not supported yet

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