@victorpotasso/fluxo
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -15,4 +15,6 @@ "use strict"; | ||
Component.call(this, selector); | ||
Component.prototype.render.call(this); | ||
subscribe(() => { | ||
Container.prototype.props = _extends({}, Container.prototype.props, mapStateToProps(getState())); | ||
Container.prototype.props = _extends({}, Container.prototype.props, mapStateToProps(getState)); | ||
Component.prototype.render.call(this); | ||
@@ -22,5 +24,6 @@ }); | ||
Container.prototype.props = _extends({}, mapStateToProps(getState()), mapDispatchToProps(dispatch, Component.prototype.props)); | ||
Container.prototype.props = _extends({}, mapStateToProps(getState), mapDispatchToProps(dispatch, Component.prototype.props)); | ||
Object.setPrototypeOf(Container.prototype, Component.prototype); | ||
return Container; | ||
@@ -27,0 +30,0 @@ }; |
@@ -7,13 +7,15 @@ function connect(mapStateToProps, mapDispatchToProps) { | ||
Component.call(this, selector); | ||
Component.prototype.render.call(this); | ||
subscribe(() => { | ||
Container.prototype.props = { | ||
...Container.prototype.props, | ||
...mapStateToProps(getState()), | ||
...mapStateToProps(getState), | ||
} | ||
Component.prototype.render.call(this); | ||
}) | ||
}); | ||
}; | ||
Container.prototype.props = { | ||
...mapStateToProps(getState()), | ||
...mapStateToProps(getState), | ||
...mapDispatchToProps(dispatch, Component.prototype.props), | ||
@@ -23,2 +25,3 @@ }; | ||
Object.setPrototypeOf(Container.prototype, Component.prototype); | ||
return Container; | ||
@@ -25,0 +28,0 @@ } |
{ | ||
"name": "@victorpotasso/fluxo", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "vanilla flux", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
import store from './store'; | ||
import Home from './containers/home'; | ||
import * as actions from './data/actions'; | ||
store.dispatch(actions.update('initial data')); | ||
const home = new Home('section#home-view'); |
@@ -13,3 +13,2 @@ import { connect } from './../../lib'; | ||
this.button.addEventListener('click', this.onClick.bind(this)); | ||
this.render(); | ||
} | ||
@@ -26,3 +25,3 @@ | ||
render() { | ||
// console.log('Home::render props', this.props); | ||
console.log('Home::render props', this.props); | ||
this.title.textContent = this.props.value1; | ||
@@ -33,5 +32,5 @@ this.count.textContent = this.props.value2; | ||
const mapStateToProps = state => ({ | ||
value1: `Sample: ${selectors.sample(state)}`, | ||
value2: selectors.count(state), | ||
const mapStateToProps = getState => ({ | ||
value1: `Sample: ${selectors.sample(getState())}`, | ||
value2: selectors.count(getState()), | ||
}); | ||
@@ -38,0 +37,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
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
19644
489