From e22f8b65d760d50bfc559c701fcc0cbfd3d695ef Mon Sep 17 00:00:00 2001
From: Tony Crowe
Date: Fri, 10 Mar 2017 19:29:55 -0700
Subject: [PATCH] await tag basic documentation
---
docs/core-tags.md | 41 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
diff --git a/docs/core-tags.md b/docs/core-tags.md
index cf83611ff..11e4317e4 100644
--- a/docs/core-tags.md
+++ b/docs/core-tags.md
@@ -371,10 +371,49 @@ sample template shows how to use macro functions inside expressions:
```
-## Awaiting promises
+## Async content
### ``
+The `` tag is used to dynamically load in content from a data provider. The data provider can be a `Promise` or a `callback`. Once the provider returns it's results the children are rendered.
+
+await-example.marko
+```xml
+$ var personPromise = new Promise((resolve, reject) => {
+ setTimeout(function() {
+ resolve({
+ name: 'Frank'
+ });
+ }, 1000);
+});
+
+
+ Hello ${person.name}!
+
+```
+
+Advanced implementation:
++ tag signature
+ * Basic usage: ...
+ * Optional attributes (details below)
+ - client-reorder `boolean`
+ - arg `expression`
+ - arg-* `string`
+ - method `string`
+ - timeout `integer`
+ - timeout-message `string`
+ - error-message `string`
+ - placeholder `string`
+ - renderTimeout `function`
+ - renderError `function`
+ - renderPlaceholder `function`
+ - name `string`
+ - scope `expression`
+ - show-after `string`
+ * Optional child tags
+ - Loading...
+ - Request timed out
+ - Request errored
## Comments