Open bencroker opened 1 week ago
Calling $signal.toUpperCase() works, whereas $signal.length errors.
$signal.toUpperCase()
$signal.length
Error: ctx.store().signal.length.value is undefined
It would be great if we could find a way to make it work, rather than forcing people to write it as ($signal).length.
($signal).length
Perhaps we could backtrack from ctx.store().signal.length.value to ctx.store().signal.value if the former is undefined?
ctx.store().signal.length.value
ctx.store().signal.value
I realise this adds extra logic, but it’s in the name of better UX.
https://github.com/starfederation/datastar/blob/d185a5a080ac266d4131426699366dd7ddbaccba/code/ts/library/src/plugins/official/preprocessors/core/signals.ts#L8
It's possible we just need to be consistent with the rule cause it'll have to live outside of the regexp... in fact it's gonna have to build up a chain of regexp (which will be slow)
Calling
$signal.toUpperCase()
works, whereas$signal.length
errors.It would be great if we could find a way to make it work, rather than forcing people to write it as
($signal).length
.Perhaps we could backtrack from
ctx.store().signal.length.value
toctx.store().signal.value
if the former is undefined?I realise this adds extra logic, but it’s in the name of better UX.
https://github.com/starfederation/datastar/blob/d185a5a080ac266d4131426699366dd7ddbaccba/code/ts/library/src/plugins/official/preprocessors/core/signals.ts#L8