Skip to content

Deprecation: legacy await

Dylan Piercey edited this page Feb 15, 2019 · 3 revisions

The <await> tag has been updated to take advantage of new language features in Marko. Specifically tag parameters and attribute tags.

This change also removes some redundant attributes, simplifies things and provides access to the error object that the promise rejected with.

Old:

<await(person from personPromise)>
    <await-placeholder>
        Loading...
    </await-placeholder>

    <div>Hello ${person.name}!</div>
</await>

New:

<await(personPromise)>
    <@placeholder>
        Loading...
    </@placeholder>

    <@then|person|>
        <div>Hello ${person.name}!</div>
    <@then>
</await>