mirror of https://github.com/sveltejs/svelte
parent
8f52587539
commit
56b167b44f
@ -0,0 +1,19 @@
|
||||
export default {
|
||||
data: {
|
||||
thePromise: 'not actually a promise'
|
||||
},
|
||||
|
||||
html: `
|
||||
<p>the value is not actually a promise</p>
|
||||
`,
|
||||
|
||||
test(assert, component, target) {
|
||||
component.set({
|
||||
thePromise: 'still not a promise'
|
||||
});
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<p>the value is still not a promise</p>
|
||||
`);
|
||||
}
|
||||
};
|
@ -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}}
|
Loading…
Reference in new issue