oo-redux-utils
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -18,2 +18,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "AbstractComponent", { | ||
enumerable: true, | ||
get: function get() { | ||
return _AbstractComponent.default; | ||
} | ||
}); | ||
@@ -24,3 +30,5 @@ var _OOReduxUtils = _interopRequireDefault(require("./OOReduxUtils")); | ||
var _AbstractComponent = _interopRequireDefault(require("./AbstractComponent")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "oo-redux-utils", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "Utility functions for Object-oriented Redux", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -103,3 +103,3 @@ # Object-oriented Redux Utils | ||
### Use person state in React component | ||
PersonView.js | ||
PersonComponent.js | ||
@@ -110,3 +110,3 @@ // @flow | ||
import { connect } from 'react-redux'; | ||
import { OOReduxUtils } from 'oo-redux-utils'; | ||
import OOReduxUtils, { AbstractComponent } from 'oo-redux-utils'; | ||
import type { DispatchWrapper } from 'oo-redux-utils' | ||
@@ -120,9 +120,9 @@ import ModifyPersonAgeAction from './ModifyPersonAgeAction'; | ||
type Props = MappedState & DispatchWrapper; | ||
type OwnProps = {}; | ||
type Props = $Exact<{ ...MappedState, ...DispatchWrapper }; | ||
class PersonView extends React.Component<Props, {}> { | ||
class PersonComponent extends AbstractComponent<Props, {}> { | ||
modifyPersonAge = (newAge: number) => { | ||
const { dispatch } = this.props; | ||
dispatch({ type: new ModifyPersonAgeAction(newAge)}); | ||
this.dispatch(new ModifyPersonAgeAction(newAge)); | ||
}; | ||
@@ -135,3 +135,3 @@ | ||
. | ||
<.... onChange={this.modifyPersonAge} ... /> | ||
<ComponentXYZ.... onChange={this.modifyPersonAge} ... /> | ||
. | ||
@@ -141,3 +141,3 @@ } | ||
export default connect(mapAppStateToComponentProps)(PersonView); | ||
export default connect<Props, OwnProps, _, _, _, _>(mapAppStateToComponentProps)(PersonComponent); | ||
@@ -144,0 +144,0 @@ ## Full example |
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
Sorry, the diff of this file is not supported yet
27390
18
159