@hydre/commons
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -10,13 +10,10 @@ "use strict"; | ||
let res = undefined; | ||
const [obj,, { | ||
const [,, { | ||
value, | ||
get | ||
}] = a; | ||
const result = args => value ? value.call(obj, args) : get.call(obj); | ||
return { ...a[2], | ||
[value ? 'value' : 'get'](...a) { | ||
if (res === undefined) res = result(...a); | ||
if (res === undefined) res = value ? value.call(this, ...a) : get.call(this); | ||
return res; | ||
@@ -23,0 +20,0 @@ } |
{ | ||
"name": "@hydre/commons", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "You need some milk ?", | ||
@@ -5,0 +5,0 @@ "author": "Hydre", |
@@ -36,5 +36,7 @@ import tape from 'blue-tape' | ||
class Foo { | ||
i = 0 | ||
z = 0 | ||
@cache | ||
bar() { | ||
if (!this.i) this.i = 0 | ||
return ++this.i | ||
@@ -45,5 +47,4 @@ } | ||
get baz() { | ||
if (!this.z) this.z = 0 | ||
return ++this.z | ||
} | ||
} |
6140
95