foxbunny/duckweed

Allow event processors that return undefined

Closed this issue · 0 comments

The duckweed.event.from() function expects the processor to always return an array. The undefined should be allowed as a return value which marks the event as 'unhandled' and suppresses the action.

This is useful, for example, when we want to handle an event like keypress only for certain keys and not for others. Currently, this decision is deferred to action handlers, which breaks the separation of concerns.