Template.onRendered
のBlaze.getData()とTemplate.currentData()を試してみましたが、ユースケースとの違いを説明します。私は流星ドキュメントを見渡しBlaze.getData()とTemplate.currentData()の相違点とそれぞれの使用例
Template.currentData()説明している:onCreated、onRendered、またはonDestroyedコールバックの内側に
- を、テンプレートのデータコンテキストを返します。
- 結果に反応的な依存関係を確立します。
Blaze.getData([elementOrView]):
- 現在のデータ・コンテキスト、または流星テンプレートから特定のDOM要素またはビューをレンダリングする際に使用されたデータコンテキストを返します。また
Establishes a reactive dependency on the result
が、これはTemplate.currentData