Skip to content

Commit

Permalink
Merge pull request #1318 from geneukum/swap-find-findall-examples
Browse files Browse the repository at this point in the history
[DOC] Swap `find` and `findAll` examples
  • Loading branch information
chriskrycho authored Jan 19, 2023
2 parents 324cdbd + 233771e commit de58ed3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
10 changes: 5 additions & 5 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,10 @@ Find the first element matched by the given selector. Equivalent to calling

#### Examples

Find all of the elements matching '.my-selector'.
Finding the first element with id 'foo'

```javascript
findAll('.my-selector');
find('#foo');
```

Returns **([Element][65] | null)** matched element or null
Expand All @@ -515,10 +515,10 @@ of a `NodeList`.

#### Examples

Finding the first element with id 'foo'
Find all of the elements matching '.my-selector'.

```javascript
find('#foo');
findAll('.my-selector');
```

Returns **[Array][70]** array of matched elements
Expand Down Expand Up @@ -834,7 +834,7 @@ Responsible for:

#### Parameters

* `context` **[Object][72]** the context to setup
* `base` **[Object][72]** the context to setup
* `options` **[Object][72]?** options used to override defaults (optional, default `{}`)

* `options.resolver` **Resolver?** a resolver to use for customizing normal resolution
Expand Down
4 changes: 2 additions & 2 deletions addon-test-support/@ember/test-helpers/dom/find-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export default function findAll(selector: string): Element[];
@example
<caption>
Finding the first element with id 'foo'
Find all of the elements matching '.my-selector'.
</caption>
find('#foo');
findAll('.my-selector');
*/
export default function findAll(selector: string): Element[] {
if (!selector) {
Expand Down
5 changes: 2 additions & 3 deletions addon-test-support/@ember/test-helpers/dom/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ export default function find(selector: string): Element | null;
@example
<caption>
Find all of the elements matching '.my-selector'.
Finding the first element with id 'foo'
</caption>
findAll('.my-selector');
find('#foo');
*/
export default function find(selector: string): Element | null {
if (!selector) {
Expand Down

0 comments on commit de58ed3

Please sign in to comment.