Bug Report
The example
I was trying to create a page with auto-save and an indicator.
Signals
{
data: { /* stuff to save */ },
version: 0, // updated by the frontend on every change
savedVersion: 0, // updated by the backend confirming the version saved.
}
auto-save
<div data-on-signal-patch__debounce.500ms="@post(..)"
data-on-signal-patch-filter="{include: /^data/}"
></div>
indicator
<div data-on-signal-patch="$version++"
data-on-signal-patch-filter="{include: /^data/}"
data-text="($version === $savedVersion) ? 'saved' : 'saving'"
></div>
What happens
- User clicks on something,
{ data: .. } is updated
- The non-debounced on-signal-patch runs immediately and receives changes
{ data: .. }. It sets { version: 1 }
- The debounced on-signal-patch runs after its delay, but receives changes { version: 1 } and the filter is applied, so the value isn't evaluated.
What I expected
I expected the debounced on-signal-patch to react to { data: .. } but that is not what it received.
I also notice that evt is undefined when the value is run, which is not entirely unexpected.
Datastar Version
v1.0.0-RC.7
Bug Report
The example
I was trying to create a page with auto-save and an indicator.
Signals
auto-save
indicator
What happens
{ data: .. }is updated{ data: .. }. It sets { version: 1 }What I expected
I expected the debounced on-signal-patch to react to { data: .. } but that is not what it received.
I also notice that
evtis undefined when the value is run, which is not entirely unexpected.Datastar Version
v1.0.0-RC.7