I'm trying to model an interactive text input field.
The best approach I can come up with is this:
- The text field receives the current text in its input signal from an upstream behavior reading a storage resource.
- The text field's output signal initially is just a copy/passthrough of the input signal.
- When the user types a new character, the output signal changes to the new, tentative text contents. (Let's ignore cursor and keyboard for now.)
- The behavior downstream of the text field sees the new text contents and writes it to the store.
- The text field's input signal (read from the store) now changes to the new text, so the display gets updated, and we're done.
I don't really like this approach. I doesn't feel declarative to me. Also, what happens if an error occurs and the new text can't be written to the store?
I'd be glad for some insights into this, also how the (still mysterious to me) Kahn Process Networks could address something like that.
Best regards,
Manuel