Signals are a light-weight messaging tools for Lua and the Corona SDK.
Lua
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
readme.textile
signal.lua

readme.textile

signal.lua

A simple implementation of Signals for Lua and Ansca’s Corona SDK by Josh Tynjala. Inspired by as3-signals, the ActionScript implementation by Robert Penner.

Usage

local signal = require("signal")

local function onSignalListener(message)
	-- prints "signal says:   hello!  nil"
	print("signal says:", message, self)
end

local myTable = {}
function myTable:method(message)
	-- prints "signal says:   hello!  table: ########"
	print("signal says:", message, self)
end

local onSignal = signal.new()
onSignal:add(onSignalListener) --no scope
onSignal:add(myTable.method, myTable) --include scope
onSignal:dispatch("hello!")