@onehat/data 1.19.11 → 1.19.13

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.19.11",
3
+ "version": "1.19.13",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -488,7 +488,7 @@ class AjaxRepository extends Repository {
488
488
  * @returns {entity} The newly updated entity
489
489
  * @fires reloadEntity,beforeLoad,changeData,load,error
490
490
  */
491
- reloadEntity = async (entity, callback = null) => {
491
+ async reloadEntity(entity, callback = null) { // use this notation so we can override it in subclasses
492
492
  if (this.isDestroyed) {
493
493
  this.throwError('this.reloadEntity is no longer valid. Repository has been destroyed.');
494
494
  return;
@@ -279,6 +279,9 @@ export default class Schema extends EventEmitter {
279
279
  }
280
280
  }
281
281
  }
282
+ if (_.isFunction(defaultValue)) {
283
+ defaultValue = defaultValue();
284
+ }
282
285
  found[property.name] = defaultValue;
283
286
  });
284
287
  return found;