Skip to content

Commit

Permalink
Event ignores filter and pattern for multiple events
Browse files Browse the repository at this point in the history
When registering multiple events at once, the recursive code ignores
passed in filter and pattern value.
  • Loading branch information
hgschmie committed May 28, 2024
1 parent 93f75e4 commit f350eb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib/event/event.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function Event.register(event_id, handler, filter, pattern, options)
--Recursively handle event id tables
if Type.Table(event_id) then
for _, id in pairs(event_id) do
Event.register(id, handler)
Event.register(id, handler, pattern, options)
end
return Event
end
Expand Down Expand Up @@ -206,7 +206,7 @@ function Event.remove(event_id, handler, filter, pattern)
-- Handle recursion here
if Type.Table(event_id) then
for _, id in pairs(event_id) do
Event.remove(id, handler)
Event.remove(id, handler, filter, pattern)
end
return Event
end
Expand Down

0 comments on commit f350eb1

Please sign in to comment.