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