Skip to content
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 () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related to the deletions?
If not, what is this related to?

Copy link
Contributor Author

@alexwizp alexwizp Dec 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see removed src/legacy/ui/public/utils/base_object.ts file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lizozom sorry for not detailed answer. Please see next diagram

Untitled Diagram (1)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a great explanation

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