mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
Merge pull request #78 from palmettos/master
Fixed #77 - Allow registering functions to signal patterns
This commit is contained in:
commit
22d0fb6960
@ -64,6 +64,13 @@ function Registry:emitPattern(p, ...)
|
||||
end
|
||||
end
|
||||
|
||||
function Registry:registerPattern(p, f)
|
||||
for s in pairs(self) do
|
||||
if s:match(p) then self:register(s, f) end
|
||||
end
|
||||
return f
|
||||
end
|
||||
|
||||
function Registry:removePattern(p, ...)
|
||||
for s in pairs(self) do
|
||||
if s:match(p) then self:remove(s, ...) end
|
||||
|
Loading…
Reference in New Issue
Block a user