Skip to content

Commit

Permalink
Add documentation for Event Listens Propagate argument. Fixes #6912 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
riffaud authored Nov 26, 2021
1 parent 6db8d22 commit 649eaf3
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/reference-1.0.3.html
Original file line number Diff line number Diff line change
Expand Up @@ -19773,9 +19773,9 @@ <h3 id='evented-method'>Methods</h3>
</td>
</tr>
<tr id='evented-listens'>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</nobr></code></td>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
<td><code>Boolean</code></td>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it. The verification can optionally be propagated, it will return <code>true</code> if parents have the listener attached to it.</p>
</td>
</tr>
<tr id='evented-once'>
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-1.1.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -19903,9 +19903,9 @@ <h3 id='evented-method'>Methods</h3>
</td>
</tr>
<tr id='evented-listens'>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</nobr></code></td>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
<td><code>Boolean</code></td>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it. The verification can optionally be propagated, it will return <code>true</code> if parents have the listener attached to it.</p>
</td>
</tr>
<tr id='evented-once'>
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-1.2.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -19918,9 +19918,9 @@ <h3 id='evented-method'>Methods</h3>
</td>
</tr>
<tr id='evented-listens'>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</nobr></code></td>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
<td><code>Boolean</code></td>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it. The verification can optionally be propagated, it will return <code>true</code> if parents have the listener attached to it.</p>
</td>
</tr>
<tr id='evented-once'>
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-1.3.4.html
Original file line number Diff line number Diff line change
Expand Up @@ -20120,9 +20120,9 @@ <h3 id='evented-method'>Methods</h3>
</td>
</tr>
<tr id='evented-listens'>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</nobr></code></td>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
<td><code>Boolean</code></td>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it. The verification can optionally be propagated, it will return <code>true</code> if parents have the listener attached to it.</p>
</td>
</tr>
<tr id='evented-once'>
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-1.4.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -20133,9 +20133,9 @@ <h3 id='evented-method'>Methods</h3>
</td>
</tr>
<tr id='evented-listens'>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</nobr></code></td>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
<td><code>Boolean</code></td>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it. The verification can optionally be propagated, it will return <code>true</code> if parents have the listener attached to it.</p>
</td>
</tr>
<tr id='evented-once'>
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-1.6.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -21025,9 +21025,9 @@ <h3 id='evented-method'>Methods</h3>
</td>
</tr>
<tr id='evented-listens'>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
<td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
<td><code>Boolean</code></td>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
<td><p>Returns <code>true</code> if a particular event type has any listeners attached to it. The verification can optionally be propagated, it will return <code>true</code> if parents have the listener attached to it.</p>
</td>
</tr>
<tr id='evented-once'>
Expand Down
3 changes: 2 additions & 1 deletion src/core/Events.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,9 @@ export var Events = {
return this;
},

// @method listens(type: String): Boolean
// @method listens(type: String, propagate?: Boolean): Boolean
// Returns `true` if a particular event type has any listeners attached to it.
// The verification can optionally be propagated, it will return `true` if parents have the listener attached to it.
listens: function (type, propagate) {
if (typeof type !== 'string') {
console.warn('"string" type argument expected');
Expand Down

0 comments on commit 649eaf3

Please sign in to comment.