@kaspernj/api-maker 1.0.137 → 1.0.138

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  ]
17
17
  },
18
18
  "name": "@kaspernj/api-maker",
19
- "version": "1.0.137",
19
+ "version": "1.0.138",
20
20
  "description": "",
21
21
  "main": "index.js",
22
22
  "repository": {
@@ -20,11 +20,6 @@ export default class ApiMakerEventUpdated extends React.PureComponent {
20
20
  onUpdated: PropTypes.func.isRequired
21
21
  })
22
22
 
23
- constructor (props) {
24
- super(props)
25
- this.onConnected = this.onConnected.bind(this)
26
- }
27
-
28
23
  componentDidMount () {
29
24
  this.connect()
30
25
  }
@@ -35,17 +30,17 @@ export default class ApiMakerEventUpdated extends React.PureComponent {
35
30
  }
36
31
 
37
32
  if (this.onConnectedListener) {
38
- this.connectUpdated.events.removeListener("connected", this.onConnected)
33
+ this.connectUpdated.events.removeListener("connected", this.props.onConnected)
39
34
  }
40
35
  }
41
36
 
42
37
  connect () {
43
38
  const {model, onConnected} = this.props
44
39
 
45
- this.connectUpdated = ModelEvents.connectUpdated(model, (...args) => this.onUpdated(...args))
40
+ this.connectUpdated = ModelEvents.connectUpdated(model, this.onUpdated)
46
41
 
47
42
  if (onConnected) {
48
- this.connectUpdated.events.addListener("connected", this.onConnected)
43
+ this.onConnectedListener = this.connectUpdated.events.addListener("connected", this.props.onConnected)
49
44
  }
50
45
  }
51
46
 
@@ -61,11 +56,7 @@ export default class ApiMakerEventUpdated extends React.PureComponent {
61
56
  return this.debounceInstance
62
57
  }
63
58
 
64
- onConnected () {
65
- this.props.onConnected()
66
- }
67
-
68
- onUpdated (...args) {
59
+ onUpdated = (...args) => {
69
60
  if (!this.props.active) {
70
61
  return
71
62
  }
@@ -63,5 +63,5 @@ export default (WrappedComponent, ModelClass, args = {}) => class modelLoadWrapp
63
63
  )
64
64
  }
65
65
 
66
- onUpdated = ({model}) => this.setState({model})
66
+ onUpdated = () => this.loadExistingModel()
67
67
  }