From fc1af610249301a3587226ac9c5e050db4139733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Am=C3=A9rico?= Date: Mon, 3 Jun 2019 19:49:37 -0300 Subject: [PATCH] Add computed properties doc and example --- docs/_harp/docs/guide/_data.json | 4 ++ .../guide/_sections/computed-properties.md | 5 +++ examples/computed.html | 41 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 docs/_harp/docs/guide/_sections/computed-properties.md create mode 100644 examples/computed.html diff --git a/docs/_harp/docs/guide/_data.json b/docs/_harp/docs/guide/_data.json index 386b12b2a..877b31205 100644 --- a/docs/_harp/docs/guide/_data.json +++ b/docs/_harp/docs/guide/_data.json @@ -59,6 +59,10 @@ } } }, + "computed-properties": { + "title": "Computed Properties", + "sections": {} + }, "iteration": { "title": "Iteration binding", "sections": {} diff --git a/docs/_harp/docs/guide/_sections/computed-properties.md b/docs/_harp/docs/guide/_sections/computed-properties.md new file mode 100644 index 000000000..5f87f1975 --- /dev/null +++ b/docs/_harp/docs/guide/_sections/computed-properties.md @@ -0,0 +1,5 @@ +Computed properties are re-evaluated when one or more dependent properties change. Declaring computed properties in Tinybind.js is possible by using buitin `watch` formatter followed by its dependencies. The following text binding will get re-evaluated when either the event's `start` or `end` attribute changes. + +```html + +``` diff --git a/examples/computed.html b/examples/computed.html new file mode 100644 index 000000000..c7569ccd0 --- /dev/null +++ b/examples/computed.html @@ -0,0 +1,41 @@ + + + + + + + + + + Computed + + + +

Computed properties

+
+ + + + +
+ + + + + + \ No newline at end of file