Skip to content

Deprecation: legacy await

Taylor Hunt edited this page Aug 2, 2019 · 3 revisions

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

This change removes some redundant attributes, simplifies things, and provides access to the error object that the promise rejects with inside <@catch>.

The older syntax:

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

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

…is replaced with <@placeholder> and <@then> attribute tags:

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

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