Amy Blankenship
Jun 19, 2024

--

This kind of reminds me of something I did years ago for event handling in Flex. I built a doubly-linked list that contained objects with a "decideResponsibility" and "handleResponsibility" function. If the object decided it had responsibility, it would handle the responsibility and we were done. But if it did not handle the responsibility, it would pass it down to the next link, and so on. In order to make handlers higher priority, you added them toward the front of the list, lower priority to the back. If circumstances changed how you handled events, you'd simply remove handlers that were no longer needed and add new ones. Today I'd probably just recreate the whole thing in that case :).

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

No responses yet