module-barejs.Evented.html 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Class: Evented</title>
  6. <script src="scripts/prettify/prettify.js"> </script>
  7. <script src="scripts/prettify/lang-css.js"> </script>
  8. <!--[if lt IE 9]>
  9. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  10. <![endif]-->
  11. <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
  12. <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
  13. </head>
  14. <body>
  15. <div id="main">
  16. <h1 class="page-title">Class: Evented</h1>
  17. <section>
  18. <header>
  19. <h2><span class="attribs"><span class="type-signature"></span></span>
  20. <span class="ancestors"><a href="module-barejs.html">barejs</a>.</span>Evented<span class="signature">()</span><span class="type-signature"></span></h2>
  21. <div class="class-description"><p>Evented is a base class that adds Eventing to JavaScript Objects.
  22. Extends Destroyable to automatically remove listeners if the object is destroyed.
  23. If handles given to the listener are <a href="module-barejs.Destroyable.html#own">own</a>ed (or manually destroyed at the appropiate time),
  24. the event link between Evented and its listener will be removed as soon as either party is destroyed.</p></div>
  25. </header>
  26. <article>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h4 class="name" id="Evented"><span class="type-signature"></span>new Evented<span class="signature">()</span><span class="type-signature"></span></h4>
  30. <div class="description">
  31. <p>The evented constructor will invoke the Destroyable constructor to ensure the object is initialized correctly.</p>
  32. </div>
  33. <dl class="details">
  34. <dt class="tag-source">Source:</dt>
  35. <dd class="tag-source"><ul class="dummy"><li>
  36. <a href="Evented.js.html">Evented.js</a>, <a href="Evented.js.html#line125">line 125</a>
  37. </li></ul></dd>
  38. </dl>
  39. </div>
  40. <h3 class="subsection-title">Extends</h3>
  41. <ul>
  42. <li><a href="module-barejs.Destroyable.html">module:barejs.Destroyable</a></li>
  43. </ul>
  44. <h3 class="subsection-title">Classes</h3>
  45. <dl>
  46. <dt><a href="module-barejs.Evented-EventedHandle.html">EventedHandle</a></dt>
  47. <dd></dd>
  48. </dl>
  49. <h3 class="subsection-title">Methods</h3>
  50. <h4 class="name" id="addDestroyListener"><span class="type-signature"></span>addDestroyListener<span class="signature">(_listener)</span><span class="type-signature"> &rarr; {function}</span></h4>
  51. <div class="description">
  52. <p>Register a destroy listener for this Destroyable object.</p>
  53. </div>
  54. <h5>Parameters:</h5>
  55. <table class="params">
  56. <thead>
  57. <tr>
  58. <th>Name</th>
  59. <th>Type</th>
  60. <th class="last">Description</th>
  61. </tr>
  62. </thead>
  63. <tbody>
  64. <tr>
  65. <td class="name"><code>_listener</code></td>
  66. <td class="type">
  67. <span class="param-type"><a href="module-barejs.Destroyable.html#~DestroyListener">module:barejs.Destroyable~DestroyListener</a></span>
  68. </td>
  69. <td class="description last"><p>The listener function to add.</p></td>
  70. </tr>
  71. </tbody>
  72. </table>
  73. <dl class="details">
  74. <dt class="inherited-from">Inherited From:</dt>
  75. <dd class="inherited-from"><ul class="dummy"><li>
  76. <a href="module-barejs.Destroyable.html#addDestroyListener">module:barejs.Destroyable#addDestroyListener</a>
  77. </li></ul></dd>
  78. <dt class="tag-source">Source:</dt>
  79. <dd class="tag-source"><ul class="dummy"><li>
  80. <a href="Destroyable.js.html">Destroyable.js</a>, <a href="Destroyable.js.html#line332">line 332</a>
  81. </li></ul></dd>
  82. </dl>
  83. <h5>Returns:</h5>
  84. <div class="param-desc">
  85. <p>the listener</p>
  86. </div>
  87. <dl>
  88. <dt>
  89. Type
  90. </dt>
  91. <dd>
  92. <span class="param-type">function</span>
  93. </dd>
  94. </dl>
  95. <h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span class="signature">()</span><span class="type-signature"></span></h4>
  96. <div class="description">
  97. <p>Destroy the Evented object. This will clean up the object, removing any links to listeners.</p>
  98. </div>
  99. <dl class="details">
  100. <dt class="tag-overrides">Overrides:</dt>
  101. <dd class="tag-overrides"><ul class="dummy"><li>
  102. <a href="module-barejs.Destroyable.html#destroy">module:barejs.Destroyable#destroy</a>
  103. </li></ul></dd>
  104. <dt class="tag-source">Source:</dt>
  105. <dd class="tag-source"><ul class="dummy"><li>
  106. <a href="Evented.js.html">Evented.js</a>, <a href="Evented.js.html#line147">line 147</a>
  107. </li></ul></dd>
  108. </dl>
  109. <h4 class="name" id="destroyAll"><span class="type-signature"></span>destroyAll<span class="signature">(_collection)</span><span class="type-signature"></span></h4>
  110. <div class="description">
  111. <p>Utility method that will iterate a collection and destroy all items in it.</p>
  112. </div>
  113. <h5>Parameters:</h5>
  114. <table class="params">
  115. <thead>
  116. <tr>
  117. <th>Name</th>
  118. <th>Type</th>
  119. <th class="last">Description</th>
  120. </tr>
  121. </thead>
  122. <tbody>
  123. <tr>
  124. <td class="name"><code>_collection</code></td>
  125. <td class="type">
  126. <span class="param-type">object</span>
  127. </td>
  128. <td class="description last"><p>An object with a forEach method or length property (e.g. an Array).</p></td>
  129. </tr>
  130. </tbody>
  131. </table>
  132. <dl class="details">
  133. <dt class="inherited-from">Inherited From:</dt>
  134. <dd class="inherited-from"><ul class="dummy"><li>
  135. <a href="module-barejs.Destroyable.html#destroyAll">module:barejs.Destroyable#destroyAll</a>
  136. </li></ul></dd>
  137. <dt class="tag-source">Source:</dt>
  138. <dd class="tag-source"><ul class="dummy"><li>
  139. <a href="Destroyable.js.html">Destroyable.js</a>, <a href="Destroyable.js.html#line496">line 496</a>
  140. </li></ul></dd>
  141. </dl>
  142. <h4 class="name" id="emit"><span class="type-signature"></span>emit<span class="signature">(_eventName, _eventArgs)</span><span class="type-signature"> &rarr; {<a href="module-barejs.EventArgs.html">module:barejs.EventArgs</a>}</span></h4>
  143. <div class="description">
  144. <p>Emit the event with _eventName.</p>
  145. </div>
  146. <h5>Parameters:</h5>
  147. <table class="params">
  148. <thead>
  149. <tr>
  150. <th>Name</th>
  151. <th>Type</th>
  152. <th class="last">Description</th>
  153. </tr>
  154. </thead>
  155. <tbody>
  156. <tr>
  157. <td class="name"><code>_eventName</code></td>
  158. <td class="type">
  159. <span class="param-type">string</span>
  160. </td>
  161. <td class="description last"><p>The name of the event to emit.</p></td>
  162. </tr>
  163. <tr>
  164. <td class="name"><code>_eventArgs</code></td>
  165. <td class="type">
  166. <span class="param-type"><a href="module-barejs.EventArgs.html">module:barejs.EventArgs</a></span>
  167. </td>
  168. <td class="description last"><p>the event args to emit.</p></td>
  169. </tr>
  170. </tbody>
  171. </table>
  172. <dl class="details">
  173. <dt class="tag-source">Source:</dt>
  174. <dd class="tag-source"><ul class="dummy"><li>
  175. <a href="Evented.js.html">Evented.js</a>, <a href="Evented.js.html#line220">line 220</a>
  176. </li></ul></dd>
  177. </dl>
  178. <h5>Returns:</h5>
  179. <div class="param-desc">
  180. <p>_eventArgs (or null if not specified).</p>
  181. </div>
  182. <dl>
  183. <dt>
  184. Type
  185. </dt>
  186. <dd>
  187. <span class="param-type"><a href="module-barejs.EventArgs.html">module:barejs.EventArgs</a></span>
  188. </dd>
  189. </dl>
  190. <h4 class="name" id="hasListener"><span class="type-signature"></span>hasListener<span class="signature">(_eventName)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
  191. <div class="description">
  192. <p>Check if there is at least one listener for _eventName. It is highly recommended to just
  193. emit an event instead of checking if there are listeners. This method is provided for edge
  194. cases where building the event metadata is an expensive process, which should be avoided if
  195. there are no listeners.</p>
  196. </div>
  197. <h5>Parameters:</h5>
  198. <table class="params">
  199. <thead>
  200. <tr>
  201. <th>Name</th>
  202. <th>Type</th>
  203. <th class="last">Description</th>
  204. </tr>
  205. </thead>
  206. <tbody>
  207. <tr>
  208. <td class="name"><code>_eventName</code></td>
  209. <td class="type">
  210. <span class="param-type">string</span>
  211. </td>
  212. <td class="description last"><p>The name of the event to check.</p></td>
  213. </tr>
  214. </tbody>
  215. </table>
  216. <dl class="details">
  217. <dt class="tag-source">Source:</dt>
  218. <dd class="tag-source"><ul class="dummy"><li>
  219. <a href="Evented.js.html">Evented.js</a>, <a href="Evented.js.html#line267">line 267</a>
  220. </li></ul></dd>
  221. </dl>
  222. <h5>Returns:</h5>
  223. <div class="param-desc">
  224. <p>True if there is at least one listener, false otherwise.</p>
  225. </div>
  226. <dl>
  227. <dt>
  228. Type
  229. </dt>
  230. <dd>
  231. <span class="param-type">Boolean</span>
  232. </dd>
  233. </dl>
  234. <h4 class="name" id="on"><span class="type-signature"></span>on<span class="signature">(_eventName, _listener)</span><span class="type-signature"> &rarr; {<a href="module-barejs.Evented-EventedHandle.html">module:barejs.Evented~EventedHandle</a>}</span></h4>
  235. <div class="description">
  236. <p>Listen to an event. To stop listening, call destroy the returned handle. Listeners should <a href="module-barejs.Destroyable.html#own">own</a>
  237. the handle returned by this method, so it is automatically disconnected when the listener is destroyed.</p>
  238. </div>
  239. <h5>Parameters:</h5>
  240. <table class="params">
  241. <thead>
  242. <tr>
  243. <th>Name</th>
  244. <th>Type</th>
  245. <th class="last">Description</th>
  246. </tr>
  247. </thead>
  248. <tbody>
  249. <tr>
  250. <td class="name"><code>_eventName</code></td>
  251. <td class="type">
  252. <span class="param-type">string</span>
  253. </td>
  254. <td class="description last"><p>The event to listen to.</p></td>
  255. </tr>
  256. <tr>
  257. <td class="name"><code>_listener</code></td>
  258. <td class="type">
  259. <span class="param-type"><a href="module-barejs.Evented.html#~EventListener">module:barejs.Evented~EventListener</a></span>
  260. </td>
  261. <td class="description last"><p>The callback to call if the event occurs.</p></td>
  262. </tr>
  263. </tbody>
  264. </table>
  265. <dl class="details">
  266. <dt class="tag-source">Source:</dt>
  267. <dd class="tag-source"><ul class="dummy"><li>
  268. <a href="Evented.js.html">Evented.js</a>, <a href="Evented.js.html#line171">line 171</a>
  269. </li></ul></dd>
  270. </dl>
  271. <h5>Returns:</h5>
  272. <dl>
  273. <dt>
  274. Type
  275. </dt>
  276. <dd>
  277. <span class="param-type"><a href="module-barejs.Evented-EventedHandle.html">module:barejs.Evented~EventedHandle</a></span>
  278. </dd>
  279. </dl>
  280. <h4 class="name" id="once"><span class="type-signature"></span>once<span class="signature">(_eventName, _listener)</span><span class="type-signature"> &rarr; {<a href="module-barejs.Evented-EventedHandle.html">module:barejs.Evented~EventedHandle</a>}</span></h4>
  281. <div class="description">
  282. <p>Listen for an event, automatically detaching after one invocation of the listener.</p>
  283. </div>
  284. <h5>Parameters:</h5>
  285. <table class="params">
  286. <thead>
  287. <tr>
  288. <th>Name</th>
  289. <th>Type</th>
  290. <th class="last">Description</th>
  291. </tr>
  292. </thead>
  293. <tbody>
  294. <tr>
  295. <td class="name"><code>_eventName</code></td>
  296. <td class="type">
  297. <span class="param-type">string</span>
  298. </td>
  299. <td class="description last"><p>The event to listen to.</p></td>
  300. </tr>
  301. <tr>
  302. <td class="name"><code>_listener</code></td>
  303. <td class="type">
  304. <span class="param-type"><a href="module-barejs.Evented.html#~EventListener">module:barejs.Evented~EventListener</a></span>
  305. </td>
  306. <td class="description last"><p>The callback to call (once) if the event occurs.</p></td>
  307. </tr>
  308. </tbody>
  309. </table>
  310. <dl class="details">
  311. <dt class="tag-source">Source:</dt>
  312. <dd class="tag-source"><ul class="dummy"><li>
  313. <a href="Evented.js.html">Evented.js</a>, <a href="Evented.js.html#line195">line 195</a>
  314. </li></ul></dd>
  315. </dl>
  316. <h5>Returns:</h5>
  317. <dl>
  318. <dt>
  319. Type
  320. </dt>
  321. <dd>
  322. <span class="param-type"><a href="module-barejs.Evented-EventedHandle.html">module:barejs.Evented~EventedHandle</a></span>
  323. </dd>
  324. </dl>
  325. <h4 class="name" id="own"><span class="type-signature"></span>own<span class="signature">()</span><span class="type-signature"> &rarr; {Array}</span></h4>
  326. <div class="description">
  327. <p>Own a number of handles. Returns an array of the owned handles.</p>
  328. </div>
  329. <dl class="details">
  330. <dt class="inherited-from">Inherited From:</dt>
  331. <dd class="inherited-from"><ul class="dummy"><li>
  332. <a href="module-barejs.Destroyable.html#own">module:barejs.Destroyable#own</a>
  333. </li></ul></dd>
  334. <dt class="tag-source">Source:</dt>
  335. <dd class="tag-source"><ul class="dummy"><li>
  336. <a href="Destroyable.js.html">Destroyable.js</a>, <a href="Destroyable.js.html#line362">line 362</a>
  337. </li></ul></dd>
  338. </dl>
  339. <h5>Returns:</h5>
  340. <div class="param-desc">
  341. <p>The owned handles.</p>
  342. </div>
  343. <dl>
  344. <dt>
  345. Type
  346. </dt>
  347. <dd>
  348. <span class="param-type">Array</span>
  349. </dd>
  350. </dl>
  351. <h4 class="name" id="ownMember"><span class="type-signature"></span>ownMember<span class="signature">(_name, _target)</span><span class="type-signature"></span></h4>
  352. <div class="description">
  353. <p>The ownMember function combines ref and own into 1 call. The target is owned and then ref-ed as _name.</p>
  354. </div>
  355. <h5>Parameters:</h5>
  356. <table class="params">
  357. <thead>
  358. <tr>
  359. <th>Name</th>
  360. <th>Type</th>
  361. <th class="last">Description</th>
  362. </tr>
  363. </thead>
  364. <tbody>
  365. <tr>
  366. <td class="name"><code>_name</code></td>
  367. <td class="type">
  368. <span class="param-type">string</span>
  369. </td>
  370. <td class="description last"><p>The name of the member.</p></td>
  371. </tr>
  372. <tr>
  373. <td class="name"><code>_target</code></td>
  374. <td class="type">
  375. <span class="param-type"><a href="module-barejs.Destroyable.html">module:barejs.Destroyable</a></span>
  376. </td>
  377. <td class="description last"><p>The target to own.</p></td>
  378. </tr>
  379. </tbody>
  380. </table>
  381. <dl class="details">
  382. <dt class="inherited-from">Inherited From:</dt>
  383. <dd class="inherited-from"><ul class="dummy"><li>
  384. <a href="module-barejs.Destroyable.html#ownMember">module:barejs.Destroyable#ownMember</a>
  385. </li></ul></dd>
  386. <dt class="tag-source">Source:</dt>
  387. <dd class="tag-source"><ul class="dummy"><li>
  388. <a href="Destroyable.js.html">Destroyable.js</a>, <a href="Destroyable.js.html#line481">line 481</a>
  389. </li></ul></dd>
  390. </dl>
  391. <h5>Returns:</h5>
  392. <div class="param-desc">
  393. <p>The owned _target</p>
  394. </div>
  395. <h4 class="name" id="ref"><span class="type-signature"></span>ref<span class="signature">(_name, _target)</span><span class="type-signature"></span></h4>
  396. <div class="description">
  397. <p>Reference a target as a member property that will be unlinked on destroy.
  398. If the referenced target is also Destroyable, the ref is also cleared if the target is destroyed.</p>
  399. </div>
  400. <h5>Parameters:</h5>
  401. <table class="params">
  402. <thead>
  403. <tr>
  404. <th>Name</th>
  405. <th>Type</th>
  406. <th class="last">Description</th>
  407. </tr>
  408. </thead>
  409. <tbody>
  410. <tr>
  411. <td class="name"><code>_name</code></td>
  412. <td class="type">
  413. <span class="param-type">string</span>
  414. </td>
  415. <td class="description last"><p>The name to reference.</p></td>
  416. </tr>
  417. <tr>
  418. <td class="name"><code>_target</code></td>
  419. <td class="type">
  420. <span class="param-type">object</span>
  421. </td>
  422. <td class="description last"><p>The object to assign to the reference.</p></td>
  423. </tr>
  424. </tbody>
  425. </table>
  426. <dl class="details">
  427. <dt class="inherited-from">Inherited From:</dt>
  428. <dd class="inherited-from"><ul class="dummy"><li>
  429. <a href="module-barejs.Destroyable.html#ref">module:barejs.Destroyable#ref</a>
  430. </li></ul></dd>
  431. <dt class="tag-source">Source:</dt>
  432. <dd class="tag-source"><ul class="dummy"><li>
  433. <a href="Destroyable.js.html">Destroyable.js</a>, <a href="Destroyable.js.html#line378">line 378</a>
  434. </li></ul></dd>
  435. </dl>
  436. <h5>Returns:</h5>
  437. <div class="param-desc">
  438. <p>The value of this[_name].</p>
  439. </div>
  440. <h4 class="name" id="removeDestroyListener"><span class="type-signature"></span>removeDestroyListener<span class="signature">(_listener)</span><span class="type-signature"></span></h4>
  441. <div class="description">
  442. <p>Unregister a destroy listener for this Destroyable object.</p>
  443. </div>
  444. <h5>Parameters:</h5>
  445. <table class="params">
  446. <thead>
  447. <tr>
  448. <th>Name</th>
  449. <th>Type</th>
  450. <th class="last">Description</th>
  451. </tr>
  452. </thead>
  453. <tbody>
  454. <tr>
  455. <td class="name"><code>_listener</code></td>
  456. <td class="type">
  457. <span class="param-type"><a href="module-barejs.Destroyable.html#~DestroyListener">module:barejs.Destroyable~DestroyListener</a></span>
  458. </td>
  459. <td class="description last"><p>The listener function to remove.</p></td>
  460. </tr>
  461. </tbody>
  462. </table>
  463. <dl class="details">
  464. <dt class="inherited-from">Inherited From:</dt>
  465. <dd class="inherited-from"><ul class="dummy"><li>
  466. <a href="module-barejs.Destroyable.html#removeDestroyListener">module:barejs.Destroyable#removeDestroyListener</a>
  467. </li></ul></dd>
  468. <dt class="tag-source">Source:</dt>
  469. <dd class="tag-source"><ul class="dummy"><li>
  470. <a href="Destroyable.js.html">Destroyable.js</a>, <a href="Destroyable.js.html#line348">line 348</a>
  471. </li></ul></dd>
  472. </dl>
  473. <h4 class="name" id="unref"><span class="type-signature"></span>unref<span class="signature">(_name, _value<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
  474. <div class="description">
  475. <p>Remove a reference (by name). If the name was given to ownMember, the member is NOT
  476. removed from the list of owned targets.
  477. Does NOT destroy the value currently referenced.</p>
  478. </div>
  479. <h5>Parameters:</h5>
  480. <table class="params">
  481. <thead>
  482. <tr>
  483. <th>Name</th>
  484. <th>Type</th>
  485. <th>Attributes</th>
  486. <th class="last">Description</th>
  487. </tr>
  488. </thead>
  489. <tbody>
  490. <tr>
  491. <td class="name"><code>_name</code></td>
  492. <td class="type">
  493. <span class="param-type">string</span>
  494. </td>
  495. <td class="attributes">
  496. </td>
  497. <td class="description last"><p>the name to remove the reference to</p></td>
  498. </tr>
  499. <tr>
  500. <td class="name"><code>_value</code></td>
  501. <td class="type">
  502. <span class="param-type">object</span>
  503. |
  504. <span class="param-type">function</span>
  505. </td>
  506. <td class="attributes">
  507. &lt;optional><br>
  508. </td>
  509. <td class="description last"><p>If a value is provided (and is not null), unref will only clear the reference if _value equals whatever is currently ref-ed.</p></td>
  510. </tr>
  511. </tbody>
  512. </table>
  513. <dl class="details">
  514. <dt class="inherited-from">Inherited From:</dt>
  515. <dd class="inherited-from"><ul class="dummy"><li>
  516. <a href="module-barejs.Destroyable.html#unref">module:barejs.Destroyable#unref</a>
  517. </li></ul></dd>
  518. <dt class="tag-source">Source:</dt>
  519. <dd class="tag-source"><ul class="dummy"><li>
  520. <a href="Destroyable.js.html">Destroyable.js</a>, <a href="Destroyable.js.html#line444">line 444</a>
  521. </li></ul></dd>
  522. </dl>
  523. <h3 class="subsection-title">Type Definitions</h3>
  524. <h4 class="name" id="~EventListener"><span class="type-signature"></span>EventListener<span class="signature">(_eventArgs, _sender)</span><span class="type-signature"></span></h4>
  525. <div class="description">
  526. <p>Event listeners are called with two arguments; the EventArgs and the sender.</p>
  527. </div>
  528. <h5>Parameters:</h5>
  529. <table class="params">
  530. <thead>
  531. <tr>
  532. <th>Name</th>
  533. <th>Type</th>
  534. <th class="last">Description</th>
  535. </tr>
  536. </thead>
  537. <tbody>
  538. <tr>
  539. <td class="name"><code>_eventArgs</code></td>
  540. <td class="type">
  541. <span class="param-type"><a href="module-barejs.EventArgs.html">module:barejs.EventArgs</a></span>
  542. </td>
  543. <td class="description last"><p>The EventArgs to the event.</p></td>
  544. </tr>
  545. <tr>
  546. <td class="name"><code>_sender</code></td>
  547. <td class="type">
  548. <span class="param-type"><a href="module-barejs.Evented.html">module:barejs.Evented</a></span>
  549. </td>
  550. <td class="description last"><p>The Evented object that emitted the event.</p></td>
  551. </tr>
  552. </tbody>
  553. </table>
  554. <dl class="details">
  555. <dt class="tag-source">Source:</dt>
  556. <dd class="tag-source"><ul class="dummy"><li>
  557. <a href="Evented.js.html">Evented.js</a>, <a href="Evented.js.html#line278">line 278</a>
  558. </li></ul></dd>
  559. </dl>
  560. </article>
  561. </section>
  562. </div>
  563. <nav>
  564. <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-barejs.html">barejs</a></li><li><a href="module-barejs_polyfill.html">barejs/polyfill</a></li><li><a href="module-barejs_polyfill_Intl.html">barejs/polyfill/Intl</a></li></ul><h3>Classes</h3><ul><li><a href="module-barejs.decl.html">decl</a></li><li><a href="module-barejs.decl-Enum.html">Enum</a></li><li><a href="module-barejs.decl-Interface.html">Interface</a></li><li><a href="module-barejs.decl-SpecialType.html">SpecialType</a></li><li><a href="module-barejs.Destroyable.html">Destroyable</a></li><li><a href="module-barejs.EventArgs.html">EventArgs</a></li><li><a href="module-barejs.Evented.html">Evented</a></li><li><a href="module-barejs.Evented-EventedHandle.html">EventedHandle</a></li><li><a href="module-barejs.Exception.html">Exception</a></li><li><a href="module-barejs_polyfill.Array.html">Array</a></li><li><a href="module-barejs_polyfill.Date.html">Date</a></li><li><a href="module-barejs_polyfill.EntryStore.html">EntryStore</a></li><li><a href="module-barejs_polyfill.EntryStore.Iterator.html">Iterator</a></li><li><a href="module-barejs_polyfill.Function.html">Function</a></li><li><a href="module-barejs_polyfill.Map.html">Map</a></li><li><a href="module-barejs_polyfill.Map-MapIterator.html">MapIterator</a></li><li><a href="module-barejs_polyfill.Math.html">Math</a></li><li><a href="module-barejs_polyfill.Number.html">Number</a></li><li><a href="module-barejs_polyfill.Object.html">Object</a></li><li><a href="module-barejs_polyfill.Promise.html">Promise</a></li><li><a href="module-barejs_polyfill.Set.html">Set</a></li><li><a href="module-barejs_polyfill.Set-SetIterator.html">SetIterator</a></li><li><a href="module-barejs_polyfill.String.html">String</a></li><li><a href="module-barejs_polyfill.Symbol.html">Symbol</a></li><li><a href="module-barejs_polyfill.WeakMap.html">WeakMap</a></li><li><a href="module-barejs_polyfill.WeakSet.html">WeakSet</a></li><li><a href="module-barejs_polyfill_Intl.DateTimeFormat.html">DateTimeFormat</a></li><li><a href="module-barejs_polyfill_Intl.DateTimeFormat-DateTimeFormatOptions.html">DateTimeFormatOptions</a></li><li><a href="module-barejs_polyfill_Intl.NumberFormat.html">NumberFormat</a></li><li><a href="module-barejs_polyfill_Intl.NumberFormat-NumberFormatOptions.html">NumberFormatOptions</a></li><li><a href="module-barejs_polyfill_Intl-Format.html">Format</a></li></ul>
  565. </nav>
  566. <br class="clear">
  567. <footer>
  568. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Oct 03 2018 15:59:34 GMT+0200 (W. Europe Daylight Time)
  569. </footer>
  570. <script> prettyPrint(); </script>
  571. <script src="scripts/linenumber.js"> </script>
  572. </body>
  573. </html>