Skip to content
This repository has been archived by the owner. It is now read-only.
Signals are a light-weight messaging tools for Lua and the Corona SDK.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
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!")
You can’t perform that action at this time.