datastar
datastar copied to clipboard
Two-way binding encoding modifier
When setting a signal with data-store it can be useful to encode the string, especially when it contains quotes. If this is used by data-model the data in the input will be unreadable.
I suggest a data-model.b64 (possible with uint8array) and maybe a data-model.uricomponent so that the data can be encoded / decoded automatically when it goes from / to the input / signal.
For the record, escaping quotes like ' when serialising data into the data-store works fine with data-model, but there might still be a use case for encoding the data (like handling newlines).