Skip to content

kalibora/memoization

Repository files navigation

Memoization

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;
        });
    }
}

About

A small helper for memoizing.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages