Issues with implicit variables newState and triggeringItem in 3.0.0

Alright this may work, but who wants to copy/paste and edit this every time they want to handle a double tap? In my current rules file, I have lots of such cases, and they all are a two-lines readable rule calling one function, not ten lines of code, that, if I came up with a better mousetrap, or a different log format, or whatever, I’d want to update many times.

And if I wanted three taps, this code would become pretty unwieldy and/or brittle. The lambda can’t access a var outside of it, I believe, so would you have have to prop up a similar code path for that next tap?

I hear you, it’s probably possible, and timers with lambdas are one way to have code “in the air” waiting to be executed. I was going for a building block that can be used simply in multiple places.

EDIT - ooh you’d need a Map (array) for button timers, see Rich’s Design Patterns

From this post? Also an array is akin to a list, not a map (which has keys mapping to values), so not sure I get what you are talking about.

Maybe you meant a map as in:

var Map<Item, Timer> timerMap = newHashMap

and then use triggeringItem (once that works) as the key for the timer for that source?