Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
/ signal.lua Public archive

Signals are a light-weight messaging tools for Lua and the Corona SDK.

Notifications You must be signed in to change notification settings

joshtynjala/signal.lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

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!")

About

Signals are a light-weight messaging tools for Lua and the Corona SDK.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages