Closed agdsat134 closed 3 years ago
Thanks - this is a good idea, and we'd been thinking along the same lines!
It's on the to-do-list.. My current thoughts are that we can implement it without any new syntax: if you don't provide an event function, then any uses of the endpoint name will simply return the last value that was received.
(And if you do provide a callback function, then it'll work the same as it does now, and won't allowed the name to be used as an expression)
Good point about it needing an initial value - the syntax you suggested is probably the best for that (and I guess that if you do provide an initial value, it means you're not allowed to also provide an event function)
Cheers - will implement this soon!
I wasn't sure if this is the right place to put a feature request, if not let me know.
Since processors can potentially have a lot of event inputs, I thought there may be a way we could reduce boilerplate. From my understanding this is the current best practice for adding an input and mapping it to a value:
When you add a lot of different inputs, this requires a lot more code and reduces clarity. What if we could map the value in two lines:
Or add a getter function (.getValue()) to the event identifier so you don't have to create a separate variable: