atmemo

0.1.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i atmemo

Weekly Downloads

12

Version

0.1.1

License

MIT

Unpacked Size

12 kB

Total Files

18

Last publish

Collaborators

  • pawsong