sindresorhus/define-lazy-prop

Decorator

Open

#1 opened on 2017年1月16日

GitHub で見る
 (5 comments) (5 reactions) (0 assignees)JavaScript (67 stars) (6 forks)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';
	}
}

コントリビューターガイド