Skip to content

Commit

Permalink
[ui/public/utils] Delete unused base_object & find_by_param
Browse files Browse the repository at this point in the history
Closes #51854
  • Loading branch information
alexwizp committed Dec 9, 2019
1 parent 3d36356 commit 4d02949
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 321 deletions.
21 changes: 21 additions & 0 deletions src/legacy/ui/public/state_management/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,27 @@ export function StateProvider(Private, $rootScope, $location, stateManagementCon
return this._urlParam;
};

/**
* Returns an object with each property name and value corresponding to the entries in this collection
* excluding fields started from '$', '_' and all methods
*
* @return {object}
*/
State.prototype.toObject = function () {
return _.omit(this, (value, key) => {
return key.charAt(0) === '$' || key.charAt(0) === '_' || _.isFunction(value);
});
};

/** Alias for method 'toObject'
*
* @obsolete Please use 'toObject' method instead
* @return {object}
*/
State.prototype.toJSON = function () {
return this.toObject();
};

return State;

}
57 changes: 0 additions & 57 deletions src/legacy/ui/public/utils/__tests__/base_object.js

This file was deleted.

175 changes: 0 additions & 175 deletions src/legacy/ui/public/utils/__tests__/simple_emitter.js

This file was deleted.

47 changes: 0 additions & 47 deletions src/legacy/ui/public/utils/base_object.ts

This file was deleted.

38 changes: 0 additions & 38 deletions src/legacy/ui/public/utils/find_by_param.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/legacy/ui/public/utils/simple_emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@
*/

import _ from 'lodash';
import { BaseObject } from './base_object';
import { createLegacyClass } from './legacy_class';

/**
* Simple event emitter class used in the vislib. Calls
* handlers synchronously and implements a chainable api
*
* @class
*/
createLegacyClass(SimpleEmitter).inherits(BaseObject);
export function SimpleEmitter() {
this._listeners = {};
}
Expand Down Expand Up @@ -134,4 +131,3 @@ SimpleEmitter.prototype.listenerCount = function (name) {
return count + _.size(handlers);
}, 0);
};

Loading

0 comments on commit 4d02949

Please sign in to comment.