kalibora/memoization

A small helper for memoizing.

v1.0.0 2023-03-15 06:44 UTC

This package is auto-updated.

Last update: 2024-10-20 07:12:04 UTC


README

Usage

namespace App;

use Kalibora\Memoization\MemoizationTrait;

class HeavyProcessor
{
    use MemoizationTrait;

    public function process(): void
    {
        return $this->getMemoization()->memoize(__FUNCTION__, function () {
            // Very heavy processing takes place here.

            return $value;
        });
    }
}