sindresorhus/define-lazy-prop

Decorator

Open

#1 创建于 2017年1月16日

在 GitHub 查看
 (5 评论) (5 反应) (0 负责人)JavaScript (67 star) (6 fork)user submission
enhancementhelp wanted

描述

A decorator would be perfect for this.

I'd like to wait until the Decorator proposal is stage 3 though.

Example:

const lazy = require('define-lazy-prop/decorator');

class Unicorn {
	@lazy rainbow() {
		return 'Lazily computed value';
	}
}

贡献者指南