Request: Event Handlers

Issue #19 new
Marc Syp created an issue

It's hard to describe the bounds of this request, because I think it involves a lot of use cases that I haven't discovered yet. But the basic idea is that we should have some kind of event handling system for interactions in the UI.

The use case that has got me pulling my hair out:

1) I have a drop down menu that updates a dynamic checklist. 2) I want to initialize the checklist (on selection from the drop down) with all items checked. 3) I have two buttons labeled "All" and "None", and I want to use these to allow the user to set/reset the checks in one click.

I can get the initialization to work (simple true toggle on checklist update). I can also get the All and None buttons to work (hacky detect button press that feeds a new boolean to an update checklist component). The problem is that I can't get all 3 things working together. With the All and None buttons active, the initialization protocol is overridden by a race condition.

Each event (init, all, none) have their own update checklist component fed by the checklist contents feed, which means that when the drop down changes, it fires all 3 update checklist components.

I tried to work with managing control flow in the GH world, including feeding only the boolean value to a single update checklist component, but currently I am creating an infinite loop. Will try a simpler method, but there definitely should be some sort of component that can listen to interactions from Hooey and provide a nice clean boolean value (true if last pressed).

Comments (1)

  1. Log in to comment