strictify/lazy
Composer 安装命令:
composer require strictify/lazy
包简介
README 文档
README
Add laziness to data evaluation
Requirements
PHP ^8.0
Installation
composer require strictify/lazy
Usage:
use Strictify\Lazy\LazyValue; function someSlowFunction() { sleep(5); return 42; } // assigning the value does nothing $lazy = new LazyValue(fn() => someSlowFunction()); // waits 5 seconds, returns 42 $lazy->getValue(); // immediately returns 42 $lazy->getValue();
Full static analysis; psalm will always know the correct type.
More real cases soon.
统计信息
- 总下载量: 626
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-18