Closed wagenet closed 9 months ago
Run & review this pull request in StackBlitz Codeflow.
Latest commit: 7970e8935265c375209f3b988299a18a702ef1d3
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
tl;dr:
value
on the first run of thekeepLatest
, if available (instead of previous, which is alwaysundefined
)The way to provide a default value when the value of keepLatest is false is to use another getter.
This PR adds a couple tests clarifying that behavior:
It's important to not do
because that means falsey responses (on
data
), will resolve to{}
, and cause content flashes.So to keep the latest value, you want to let the
data
response be what it actually is.In traditional logic, this could maybe be expressed this way:
when default is always truthy vs