Skip to content

About

Simple decorator for caching getters on first access

Topics

Resources

Security policy

Stars

13 stars

Watchers

1 watching

Forks

Repository files navigation

Decorator Cache Getter

NPM version NPM downloads Build status Test coverage

Simple decorator for caching getters on first access.

Installation

npm install decorator-cache-getter --save

Usage

import { cache } from "decorator-cache-getter";

class User {
  @cache
  get friends() {
    return sql("SELECT * FROM users WHERE ...")
  }
}

const user = new User()
const friends = await user.friends;

License

MIT

About

Simple decorator for caching getters on first access

Topics

Resources

Security policy

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages