@onehat/data 1.20.8 → 1.20.9

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.
@@ -1302,7 +1302,7 @@ describe('Repository Base', function() {
1302
1302
  })();
1303
1303
  });
1304
1304
 
1305
- it('getRootNodes', function() {
1305
+ it('loadRootNodes', function() {
1306
1306
  (async () => {
1307
1307
  const repository = await creatRepository();
1308
1308
  repository.assembleTreeNodes();
@@ -1310,7 +1310,7 @@ describe('Repository Base', function() {
1310
1310
  const
1311
1311
  id1 = repository.getById(1);
1312
1312
 
1313
- const rootNodes = repository.getRootNodes();
1313
+ const rootNodes = repository.loadRootNodes();
1314
1314
  expect(rootNodes).to.be.eql([id1]);
1315
1315
 
1316
1316
  destoryRepository(repository);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.20.8",
3
+ "version": "1.20.9",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -385,8 +385,8 @@ class AjaxRepository extends Repository {
385
385
  * @fires beforeLoad,changeData,load,error
386
386
  */
387
387
  load = async (params, callback = null) => {
388
- if (this.isTree && this.getRootNodes) {
389
- return this.getRootNodes();
388
+ if (this.isTree && this.loadRootNodes) {
389
+ return this.loadRootNodes();
390
390
  }
391
391
  if (this.isDestroyed) {
392
392
  this.throwError('this.load is no longer valid. Repository has been destroyed.');
@@ -179,7 +179,7 @@ class OneBuildRepository extends AjaxRepository {
179
179
 
180
180
  if (this.isLoaded && !this.eventsPaused) {
181
181
  if (this.isTree) {
182
- return this.getRootNodes(1);
182
+ return this.loadRootNodes(1);
183
183
  } else {
184
184
  return this.reload();
185
185
  }
@@ -204,7 +204,7 @@ class OneBuildRepository extends AjaxRepository {
204
204
  if (!this.eventsPaused) {
205
205
  if (this.isLoaded && this.isAutoLoad) {
206
206
  if (this.isTree) {
207
- return this.getRootNodes(1).then(() => {
207
+ return this.loadRootNodes(1).then(() => {
208
208
  this.emit('changeSorters');
209
209
  });
210
210
  } else {
@@ -583,7 +583,7 @@ class OneBuildRepository extends AjaxRepository {
583
583
  return this._send('POST', this.name + '/getNodes', data)
584
584
  .then((result) => {
585
585
  if (this.debugMode) {
586
- console.log('Response for getRootNodes', result);
586
+ console.log('Response for loadRootNodes', result);
587
587
  }
588
588
 
589
589
  if (this.isDestroyed) {
@@ -179,7 +179,7 @@ class OneBuild2Repository extends AjaxRepository {
179
179
 
180
180
  if (this.isLoaded && !this.eventsPaused) {
181
181
  if (this.isTree) {
182
- return this.getRootNodes(1);
182
+ return this.loadRootNodes(1);
183
183
  } else {
184
184
  return this.reload();
185
185
  }
@@ -204,7 +204,7 @@ class OneBuild2Repository extends AjaxRepository {
204
204
  if (!this.eventsPaused) {
205
205
  if (this.isLoaded && this.isAutoLoad) {
206
206
  if (this.isTree) {
207
- return this.getRootNodes(1).then(() => {
207
+ return this.loadRootNodes(1).then(() => {
208
208
  this.emit('changeSorters');
209
209
  });
210
210
  } else {
@@ -583,7 +583,7 @@ class OneBuild2Repository extends AjaxRepository {
583
583
  return this._send('POST', this.name + '/getNodes', data)
584
584
  .then((result) => {
585
585
  if (this.debugMode) {
586
- console.log('Response for getRootNodes', result);
586
+ console.log('Response for loadRootNodes', result);
587
587
  }
588
588
 
589
589
  if (this.isDestroyed) {
@@ -2081,10 +2081,10 @@ export default class Repository extends EventEmitter {
2081
2081
  /**
2082
2082
  * Gets the root TreeNodes
2083
2083
  */
2084
- getRootNodes = () => {
2084
+ loadRootNodes = () => {
2085
2085
  this.ensureTree();
2086
2086
  if (this.isDestroyed) {
2087
- this.throwError('this.getRootNodes is no longer valid. Repository has been destroyed.');
2087
+ this.throwError('this.loadRootNodes is no longer valid. Repository has been destroyed.');
2088
2088
  return;
2089
2089
  }
2090
2090