Software /
code /
verse
Comparison
init.lua @ 464:dc05a8d6dbfb
Fix whitespace
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 16 Mar 2023 16:47:59 +0000 |
parent | 463:98fe3ed54639 |
child | 465:6707e3a47f71 |
comparison
equal
deleted
inserted
replaced
463:98fe3ed54639 | 464:dc05a8d6dbfb |
---|---|
186 function stream:unhook(name, handler) | 186 function stream:unhook(name, handler) |
187 return self.events.remove_handler(name, handler); | 187 return self.events.remove_handler(name, handler); |
188 end | 188 end |
189 | 189 |
190 function verse.eventable(object) | 190 function verse.eventable(object) |
191 object.events = events.new(); | 191 object.events = events.new(); |
192 object.hook, object.unhook = stream.hook, stream.unhook; | 192 object.hook, object.unhook = stream.hook, stream.unhook; |
193 local fire_event = object.events.fire_event; | 193 local fire_event = object.events.fire_event; |
194 function object:event(name, ...) | 194 function object:event(name, ...) return fire_event(name, ...); end |
195 return fire_event(name, ...); | 195 return object; |
196 end | |
197 return object; | |
198 end | 196 end |
199 | 197 |
200 function stream:add_plugin(name) | 198 function stream:add_plugin(name) |
201 if self.plugins[name] then return true; end | 199 if self.plugins[name] then return true; end |
202 if require("verse.plugins."..name) then | 200 if require("verse.plugins."..name) then |