atmemo
v0.1.1
Published
decorator for class getter and method memoization
Downloads
61
Readme
atmemo
decorator for class getter and method memoization
Example
import memo from 'atmemo'
class MyModule {
@memo get field() {
return {}
}
@memo method(arg) {
return {}
}
}
const mod = new MyModule()
assert(mod.field === mod.field)
assert(mod.method(1) === mod.method(1))
assert(mod.method(1) !== mod.method(2))
assert(mod.method(2) === mod.method(2))
License
MIT