Comparing version 0.4.8 to 0.4.9
@@ -20,2 +20,53 @@ 'use strict'; | ||
/** | ||
* React element in which app should be placed if it needs to wait for the parent | ||
* frame to inject the BondCache. | ||
*/ | ||
var InjectedCacheWaiter = function (_React$Component) { | ||
_inherits(InjectedCacheWaiter, _React$Component); | ||
function InjectedCacheWaiter() { | ||
_classCallCheck(this, InjectedCacheWaiter); | ||
var _this = _possibleConstructorReturn(this, (InjectedCacheWaiter.__proto__ || Object.getPrototypeOf(InjectedCacheWaiter)).call(this)); | ||
_this.state = { haveCache: window ? window.injectedBondCache ? true : null : false }; | ||
if (_this.state.haveCache === null) { | ||
_this._timers = [window.setInterval(_this.checkInject.bind(_this), 100), window.setInterval(_this.checksTimeout.bind(_this), 2000)]; | ||
} | ||
return _this; | ||
} | ||
_createClass(InjectedCacheWaiter, [{ | ||
key: 'checkInject', | ||
value: function checkInject() { | ||
if (window.injectedBondCache) { | ||
Bond.cache = window.injectedBondCache; | ||
this._timers.forEach(window.clearInterval); | ||
this.setState({ haveCache: true }); | ||
} | ||
} | ||
}, { | ||
key: 'checksTimeout', | ||
value: function checksTimeout() { | ||
this._timers.forEach(window.clearInterval); | ||
this.setState({ haveCache: false }); | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
return this.state.haveCache === null ? React.createElement( | ||
'div', | ||
null, | ||
'Waiting for cache...' | ||
) : this.props.children; | ||
} | ||
}]); | ||
return InjectedCacheWaiter; | ||
}(React.Component); | ||
/** | ||
* @summary A derivable class for creating React components that can transparently | ||
@@ -50,4 +101,4 @@ * accept deal with prop values that are {@link Bond}s. | ||
var ReactiveComponent = function (_React$Component) { | ||
_inherits(ReactiveComponent, _React$Component); | ||
var ReactiveComponent = function (_React$Component2) { | ||
_inherits(ReactiveComponent, _React$Component2); | ||
@@ -75,8 +126,8 @@ /** | ||
var _this = _possibleConstructorReturn(this, (ReactiveComponent.__proto__ || Object.getPrototypeOf(ReactiveComponent)).call(this)); | ||
var _this2 = _possibleConstructorReturn(this, (ReactiveComponent.__proto__ || Object.getPrototypeOf(ReactiveComponent)).call(this)); | ||
_this.reactiveProps = reactiveProps; | ||
_this.bonds = bonds; | ||
_this.allBondKeys = [].concat(reactiveProps).concat(Object.keys(bonds)); | ||
return _this; | ||
_this2.reactiveProps = reactiveProps; | ||
_this2.bonds = bonds; | ||
_this2.allBondKeys = [].concat(reactiveProps).concat(Object.keys(bonds)); | ||
return _this2; | ||
} | ||
@@ -186,6 +237,6 @@ | ||
value: function ready() { | ||
var _this2 = this; | ||
var _this3 = this; | ||
return this.allBondKeys.every(function (k) { | ||
return _this2.state[k] !== undefined; | ||
return _this3.state[k] !== undefined; | ||
}); | ||
@@ -426,2 +477,4 @@ } | ||
module.exports = { ReactiveComponent: ReactiveComponent, Rspan: Rspan, Rdiv: Rdiv, Ra: Ra, Rimg: Rimg, Hash: Hash }; | ||
module.exports = { | ||
ReactiveComponent: ReactiveComponent, Rspan: Rspan, Rdiv: Rdiv, Ra: Ra, Rimg: Rimg, Hash: Hash, InjectedCacheWaiter: InjectedCacheWaiter | ||
}; |
{ | ||
"name": "oo7-react", | ||
"version": "0.4.8", | ||
"version": "0.4.9", | ||
"description": "The Reactive Bond API", | ||
@@ -10,11 +10,10 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"lint": "echo todo", | ||
"test": "npm run compile && mocha --compilers js:babel-core/register --reporter spec", | ||
"compile": "babel --presets react -d lib/ src/", | ||
"prepublishOnly": "../oo7/prepublish.sh", | ||
"prepublish": "npm run compile", | ||
"postpublish": "../oo7/postpublish.sh" | ||
"prepare": "npm run compile" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ethcore/oo7-react.git" | ||
"url": "git+https://github.com/paritytech/oo7-react.git" | ||
}, | ||
@@ -31,7 +30,7 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/ethcore/oo7-react/issues" | ||
"url": "https://github.com/paritytech/oo7-react/issues" | ||
}, | ||
"homepage": "https://github.com/ethcore/oo7-react#readme", | ||
"homepage": "https://github.com/paritytech/oo7-react#readme", | ||
"dependencies": { | ||
"oo7": "file:../oo7", | ||
"oo7": "^0.5.9", | ||
"react": "^15.4.2" | ||
@@ -41,2 +40,3 @@ }, | ||
"babel-cli": "^6.22.2", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-react": "^6.22.0", | ||
@@ -43,0 +43,0 @@ "chai": "^3.5.0", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
28475
400
5
1
+ Addedoo7@0.5.9(transitive)
Updatedoo7@^0.5.9