@kaspernj/api-maker 1.0.199 → 1.0.202

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.199",
19
+ "version": "1.0.202",
20
20
  "description": "",
21
21
  "main": "index.js",
22
22
  "repository": {
@@ -94,8 +94,6 @@ export default class CollectionLoader extends React.PureComponent {
94
94
  this.shape.set({qParams})
95
95
  }
96
96
 
97
- loadModelsDebounce = debounce(this.loadModels)
98
-
99
97
  loadModels = async () => {
100
98
  const params = Params.parse()
101
99
  const {abilities, collection, groupBy, modelClass, onModelsLoaded, preloads, select, selectColumns} = this.props
@@ -137,7 +135,8 @@ export default class CollectionLoader extends React.PureComponent {
137
135
  })
138
136
  }
139
137
 
140
- onModelCreated = () => this.loadModels()
138
+ loadModelsDebounce = debounce(digg(this, "loadModels"))
139
+ onModelCreated = digg(this, "loadModels")
141
140
 
142
141
  onModelDestroyed = (args) => {
143
142
  const {models} = digs(this.shape, "models")
@@ -35,10 +35,12 @@ export default class ApiMakerEventCreated extends React.PureComponent {
35
35
 
36
36
  debounce () {
37
37
  if (!this.debounceInstance) {
38
+ const {onCreated} = digs(this.props, "onCreated")
39
+
38
40
  if (typeof this.props.debounce == "number") {
39
- this.debounceInstance = debounce(this.props.onCreated, this.props.debounce)
41
+ this.debounceInstance = debounce(onCreated, this.props.debounce)
40
42
  } else {
41
- this.debounceInstance = debounce(this.props.onCreated)
43
+ this.debounceInstance = debounce(onCreated)
42
44
  }
43
45
  }
44
46