Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] [ui/public/utils] Delete unused base_object & find_by_param (#52500) #52718

Merged
merged 1 commit into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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