mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-27 00:36:44 +03:00
*.jsx -> *.js
This commit is contained in:
parent
0a2b826f71
commit
e88c193334
98 changed files with 341 additions and 340 deletions
34
dev/Knoin/AbstractModel.js
Normal file
34
dev/Knoin/AbstractModel.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
import _ from '_';
|
||||
import {isArray, disposeObject} from 'Common/Utils';
|
||||
|
||||
class AbstractModel
|
||||
{
|
||||
/**
|
||||
* @param {string} modelName
|
||||
*/
|
||||
constructor(modelName)
|
||||
{
|
||||
this.sModelName = modelName || '';
|
||||
this.disposables = [];
|
||||
}
|
||||
|
||||
regDisposables(value) {
|
||||
if (isArray(value))
|
||||
{
|
||||
_.each(value, (item) => {
|
||||
this.disposables.push(item);
|
||||
});
|
||||
}
|
||||
else if (value)
|
||||
{
|
||||
this.disposables.push(value);
|
||||
}
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
disposeObject(this);
|
||||
}
|
||||
}
|
||||
|
||||
export {AbstractModel, AbstractModel as default};
|
||||
Loading…
Add table
Add a link
Reference in a new issue