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

貢獻者指南