# memoize-decorator

> Memoize getters and methods to compute only once

Latest version **1.0.2** (published 2015-04-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install memoize-decorator
pnpm add memoize-decorator
yarn add memoize-decorator
bun add memoize-decorator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2015-04-11 |
| First published | 2015-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andrey Popp |
| Maintainers | andreypopp |

## Links

- npm: https://www.npmjs.com/package/memoize-decorator
- npm.io page: https://npm.io/package/memoize-decorator

## Recent versions

- 1.0.2 (latest) — 2015-04-11
- 1.0.1 — 2015-04-11
- 1.0.0 — 2015-04-11

## README

# memoize decorator

This is a method/getter decorator which is when applied to a method or a getter
memoizes the result of the first call and returns it on subsequent calls.

As decorators are a part of future ES7 standard they can only be used with
transpilers such as [Babel](http://babeljs.io).

Installation:

    % npm install memoize-decorator

Example:

    import memoize from 'memoize-decorator'

    class Component {

      @memoize
      get expensiveValue() {
        console.log('heavy computations')
        return 42
      }
    }

    let component = new Component()
    component.expensiveValue // prints 'heavy computations', returns 42
    component.expensiveValue // just returns 42

---
_Source: https://npm.io/package/memoize-decorator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
