Skip to content

Commit

Permalink
Clarify implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleitnick committed Nov 21, 2023
1 parent 19fc2de commit a7993f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/signal/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,22 @@ setmetatable(Connection, {
--[=[
@class Signal
Signals allow events to be dispatched and handled.
A Signal is a data structure that allows events to be dispatched
and observed.
This implementation is a direct copy of the de facto standard, [GoodSignal](https://devforum.roblox.com/t/lua-signal-class-comparison-optimal-goodsignal-class/1387063),
with some added methods and typings.
For example:
```lua
local signal = Signal.new()
-- Subscribe to a signal:
signal:Connect(function(msg)
print("Got message:", msg)
end)
-- Dispatch an event:
signal:Fire("Hello world!")
```
]=]
Expand Down

0 comments on commit a7993f4

Please sign in to comment.