diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-10-25 23:28:12 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-10-25 23:28:12 +0200 |
commit | cfdfcc529dedff770dc54e78d2900d9a790f5766 (patch) | |
tree | 7b59c282a7823ded1d182aca95da5d55815456b2 /src/memory.js | |
parent | 464af8b747389b7fdb569a933591c863b9be0f6b (diff) | |
download | svg.js-cfdfcc529dedff770dc54e78d2900d9a790f5766.tar.gz svg.js-cfdfcc529dedff770dc54e78d2900d9a790f5766.zip |
convert everything to es6 classes and imports
Diffstat (limited to 'src/memory.js')
-rw-r--r-- | src/memory.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/memory.js b/src/memory.js index 57dfa02..bc13196 100644 --- a/src/memory.js +++ b/src/memory.js @@ -1,7 +1,8 @@ +import Element from './Element.js' -SVG.extend(SVG.Element, { +extend(Element, { // Remember arbitrary data - remember: function (k, v) { + remember (k, v) { // remember every item in an object individually if (typeof arguments[0] === 'object') { for (var key in k) { @@ -19,7 +20,7 @@ SVG.extend(SVG.Element, { }, // Erase a given memory - forget: function () { + forget () { if (arguments.length === 0) { this._memory = {} } else { @@ -28,10 +29,10 @@ SVG.extend(SVG.Element, { } } return this - }, + } // Initialize or return local memory object - memory: function () { + memory () { return this._memory || (this._memory = {}) } }) |