mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-13 08:02:47 +00:00
docs: condense the discard invariant to four lines
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
a68b19130f
commit
899899b284
@@ -472,11 +472,10 @@ class Entry<V> {
|
||||
}
|
||||
|
||||
discard(): Promise<DiscardOutcome> {
|
||||
// What a discard throws away is the value as of the click, the way a save sends the value
|
||||
// as of the click. One typed while it waited its turn is newer than the discard, and
|
||||
// reverting it would drop it with nothing left holding it. Measured as the value and not
|
||||
// as a count of writes: an outside write of what is already on screen changes nothing the
|
||||
// user can see, so it does not make their discard stale.
|
||||
// A discard throws away the value as of the click, as a save sends the value as of the
|
||||
// click: one typed while it waited its turn is newer, and reverting it would drop it with
|
||||
// nothing left holding it. The value and not a count of writes, so that an outside write
|
||||
// of what is already on screen, changing nothing the user sees, leaves the discard good.
|
||||
const asked = serialize(this.value)
|
||||
return this.run(async () => {
|
||||
if (!this.loaded || this.retired) return { removed: false }
|
||||
|
||||
Reference in New Issue
Block a user