mirror of https://github.com/sveltejs/svelte
parent
14b27b71e1
commit
908fe2ab7a
@ -0,0 +1,7 @@
|
|||||||
|
{{#await thePromise}}
|
||||||
|
<p>loading...</p>
|
||||||
|
{{then theValue}}
|
||||||
|
<p>the value is {{theValue}}</p>
|
||||||
|
{{catch theError}}
|
||||||
|
<p>oh no! {{theError.message}}</p>
|
||||||
|
{{/await}}
|
@ -0,0 +1,144 @@
|
|||||||
|
{
|
||||||
|
"hash": 1040536517,
|
||||||
|
"html": {
|
||||||
|
"start": 0,
|
||||||
|
"end": 158,
|
||||||
|
"type": "Fragment",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"start": 0,
|
||||||
|
"end": 158,
|
||||||
|
"type": "AwaitBlock",
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 9,
|
||||||
|
"end": 19,
|
||||||
|
"name": "thePromise"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"start": 23,
|
||||||
|
"end": 40,
|
||||||
|
"type": "Element",
|
||||||
|
"name": "p",
|
||||||
|
"attributes": [],
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"start": 26,
|
||||||
|
"end": 36,
|
||||||
|
"type": "Text",
|
||||||
|
"data": "loading..."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"value": "theValue",
|
||||||
|
"then": {
|
||||||
|
"start": 41,
|
||||||
|
"end": 93,
|
||||||
|
"type": "ThenBlock",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"start": 58,
|
||||||
|
"end": 60,
|
||||||
|
"type": "Text",
|
||||||
|
"data": "\n\t"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"start": 60,
|
||||||
|
"end": 92,
|
||||||
|
"type": "Element",
|
||||||
|
"name": "p",
|
||||||
|
"attributes": [],
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"start": 63,
|
||||||
|
"end": 76,
|
||||||
|
"type": "Text",
|
||||||
|
"data": "the value is "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"start": 76,
|
||||||
|
"end": 88,
|
||||||
|
"type": "MustacheTag",
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 78,
|
||||||
|
"end": 86,
|
||||||
|
"name": "theValue"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"start": 92,
|
||||||
|
"end": 93,
|
||||||
|
"type": "Text",
|
||||||
|
"data": "\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"error": "theError",
|
||||||
|
"catch": {
|
||||||
|
"start": 93,
|
||||||
|
"end": 148,
|
||||||
|
"type": "CatchBlock",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"start": 111,
|
||||||
|
"end": 113,
|
||||||
|
"type": "Text",
|
||||||
|
"data": "\n\t"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"start": 113,
|
||||||
|
"end": 147,
|
||||||
|
"type": "Element",
|
||||||
|
"name": "p",
|
||||||
|
"attributes": [],
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"start": 116,
|
||||||
|
"end": 123,
|
||||||
|
"type": "Text",
|
||||||
|
"data": "oh no! "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"start": 123,
|
||||||
|
"end": 143,
|
||||||
|
"type": "MustacheTag",
|
||||||
|
"expression": {
|
||||||
|
"type": "MemberExpression",
|
||||||
|
"start": 125,
|
||||||
|
"end": 141,
|
||||||
|
"object": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 125,
|
||||||
|
"end": 133,
|
||||||
|
"name": "theError"
|
||||||
|
},
|
||||||
|
"property": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 134,
|
||||||
|
"end": 141,
|
||||||
|
"name": "message"
|
||||||
|
},
|
||||||
|
"computed": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"start": 147,
|
||||||
|
"end": 148,
|
||||||
|
"type": "Text",
|
||||||
|
"data": "\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"css": null,
|
||||||
|
"js": null
|
||||||
|
}
|
Loading…
Reference in new issue