0.1.1 • Published 4 years ago

atmemo v0.1.1

Weekly downloads
25
License
MIT
Repository
github
Last release
4 years ago

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