Skip to content

ActionScript signals implementation with restricted rights for dispatching

Notifications You must be signed in to change notification settings

whitered/Signaller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Signaller ActionScript library.

Signal represents an event and allows to listen for it.

Signaller is a wrapper on Singal class. It gives the ability to dispatch events.

Both this classes are implement ISignal interface.

Typical usage:

 class Ticker
 {
   private const _onTick:Signaller = new Signaller();
  
   public const onTick:Signal = _onTick.signal;

   private function doSomething():void
   {
     ...
     _onTick.dispatch("tick!");
   }
 }


 class TickerManager
 {
   public function workWithTicker(ticker:Ticker):void
   {
     ticker.onTick.add(handleTick);

     // It's impossible to dispatch onTick signal from outside of the ticker
     // ticker.onTick.dispatch() - will fail
   }



   private function handleTick(tickerMessage:String):void
   {
     ticker.onTick.remove(handleTick);
   }
 }


About

ActionScript signals implementation with restricted rights for dispatching

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published