Allow registering functions to signal patterns

This commit is contained in:
palmettos 2017-02-05 16:43:59 -05:00 committed by GitHub
parent 40aa4cb7c5
commit 6154e24b49

View File

@ -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