This is not a core part of ember-resources, but is an example utility to demonstrate a concept when authoring your own resources. However, this utility is still under the broader library's SemVer policy.
A consuming app will not pay for the bytes of this utility unless imported.
An example utility that uses resource
Any tracked data accessed in a tracked function before an await
will "entangle" with the function -- we can call these accessed tracked
properties, the "tracked prelude". If any properties within the tracked
payload change, the function will re-run.
This is not a core part of ember-resources, but is an example utility to demonstrate a concept when authoring your own resources. However, this utility is still under the broader library's SemVer policy.
A consuming app will not pay for the bytes of this utility unless imported.
An example utility that uses resource
Any tracked data accessed in a tracked function before an
await
will "entangle" with the function -- we can call these accessed tracked properties, the "tracked prelude". If any properties within the tracked payload change, the function will re-run.Note, this example uses the proposed
<template>
syntax from the First-Class Component Templates RFCAlso note that after an
await
, thethis
context should not be accessed as it could lead to destruction/timing issues.