View unanswered posts | View active topics



Reply to topic  [ 1 post ] 
A few simple snippets 
Author Message
Member

Joined: Mon Dec 03, 2012 11:05 am
Posts: 8
Reply with quote
Here's a couple of basic snippets that I use all the time

name: unlisten

(event_.target as EventDispatcher).removeEventListener(event_.type, $(MbrName));

result:
Code:
 (event_.target as EventDispatcher).removeEventListener(event_.type, currentMethod);

a quick way to remove an event listener from within a method
obviously it depends on using 'event_' as the parameter name


name: throw

throw(new Error('$(MbrName)(): $(EntryPoint)'));

result:
Code:
throw(new Error('currentMethod(): '));

great for a default handler for unspecified conditions in a switch statement etc


Thu Sep 04, 2014 4:14 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.