1 Star 0 Fork 0

wellsfrog/as3-signals-event

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.textile 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
Robert Penner 提交于 2015-10-08 21:13 . Fix blog links in README

Signals: Think Outside the Event.

Signals are light-weight, strongly-typed AS3 messaging tools.
Wire your application with better APIs and less boilerplate than AS3 Events.

Concept

  • A Signal is essentially a mini-dispatcher specific to one event, with its own array of listeners.
  • A Signal gives an event a concrete membership in a class.
  • Listeners subscribe to real objects, not to string-based channels.
  • Event string constants are no longer needed.
  • Signals are inspired by C# events and signals/slots in Qt.

Syntax

// with EventDispatcher
button.addEventListener(MouseEvent.CLICK, onClick);

// Signal equivalent; past tense is recommended
button.clicked.add(onClicked);

I am still looking for impressions, critiques and suggestions.
My email is robert at robertpenner.com.
I’m @robpenner on Twitter.

Background on AS3 Events

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wellsfrog/as3-signals-event.git
git@gitee.com:wellsfrog/as3-signals-event.git
wellsfrog
as3-signals-event
as3-signals-event
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385