@memoize/getters
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@memoize/getters

Commit a getter's result for one-time evaluation.

🚀 Usage

import { memoize_getters } from "@memoize/getters";

const myObject = memoize_getters({
  get answer() {
    return discover_the_meaning_of_life();
  },
});

myObject.answer; // 42

Where ordinarily, that would look like { answer: discover_the_meaning_of_life() } for a value somebody may never read.

❤️ Thanks

Special thanks to @wongmjane for the implementation and idea!

License

MIT © Marais Rossouw

Readme

Keywords

none

Package Sidebar

Install

npm i @memoize/getters

Weekly Downloads

2

Version

0.0.1

License

none

Unpacked Size

3.61 kB

Total Files

6

Last publish

Collaborators

  • marais