SignalK / SensESP

Universal Signal K sensor framework for the ESP32 platform
https://signalk.org/SensESP/
Apache License 2.0
150 stars 81 forks source link

Create an alternate LambdaTransform that only conditionally emits values #571

Open mairas opened 2 years ago

mairas commented 2 years ago

The current LambdaTransform implementation expects a lambda function that always returns a value that will be subsequently emitted. Most of the time, this is what you'd want, but sometimes you might want to avoid emitting a value if, for example, the output is invalid. For such cases, it would be useful to have an alternative lambda variant that doesn't return anything but allows calling of LambdaTransform::emit() manually.